IPv4 protocol. SNMP protocol (basics) What is tcp ip for dummies

IPv4 protocol. SNMP protocol (basics) What is tcp ip for dummies

In the modern world, information spreads in a matter of seconds. The news has just appeared, and a second later it is already available on some website on the Internet. The Internet is considered one of the most useful developments of the human mind. To enjoy all the benefits that the Internet provides, you need to connect to this network.

Few people know that the simple process of visiting web pages involves a complex system of actions, invisible to the user. Each click on a link activates hundreds of different computational operations at the heart of the computer. These include sending requests, receiving responses, and much more. The so-called TCP/IP protocols are responsible for every action on the network. What are they?

Any Internet protocol TCP/IP operates at its own level. In other words, everyone does their own thing. The entire TCP/IP protocol family does a tremendous amount of work simultaneously. And the user at this time sees only bright pictures and long lines of text.

Concept of a protocol stack

The TCP/IP protocol stack is an organized set of basic network protocols, which is hierarchically divided into four levels and is a system for transport distribution of packets over a computer network.

TCP/IP is the most famous network protocol stack in use today. The principles of the TCP/IP stack apply to both local and wide area networks.

Principles of using addresses in the protocol stack

The TCP/IP network protocol stack describes the paths and directions in which packets are sent. This is the main task of the entire stack, performed at four levels that interact with each other using a logged algorithm. To ensure that the packet is sent correctly and delivered exactly to the point that requested it, IP addressing was introduced and standardized. This was due to the following tasks:

  • Addresses of different types must be consistent. For example, converting a website domain to a server's IP address and back, or converting a host name to an address and back. In this way, it becomes possible to access the point not only using the IP address, but also by its intuitive name.
  • Addresses must be unique. This is because in some special cases the packet must reach only one specific point.
  • The need to configure local area networks.

In small networks where several dozen nodes are used, all these tasks are performed simply, using the simplest solutions: compiling a table describing the ownership of the machine and its corresponding IP address, or you can manually distribute IP addresses to all network adapters. However, for large networks with a thousand or two thousand machines, the task of manually issuing addresses does not seem so feasible.

That is why a special approach was invented for TCP/IP networks, which became a distinctive feature of the protocol stack. The concept of scalability was introduced.

Layers of the TCP/IP protocol stack

There is a certain hierarchy here. The TCP/IP protocol stack has four layers, each of which handles its own set of protocols:

Application layer: created to provide the user with the network. At this level, everything that the user sees and does is processed. The layer allows the user to access various network services, for example: access to databases, the ability to read a list of files and open them, send an email message or open a web page. Along with user data and actions, service information is transmitted at this level.

Transport layer: This is a pure packet transmission mechanism. At this level, neither the contents of the package nor its affiliation with any action matter at all. At this level, only the address of the node from which the packet is sent and the address of the node to which the packet should be delivered matters. As a rule, the size of fragments transmitted using different protocols can change, therefore, at this level, blocks of information can be split up at the output and assembled into a single whole at the destination. This causes possible data loss if, at the time of transmission of the next fragment, a short-term connection break occurs.

The transport layer includes many protocols, which are divided into classes, from the simplest ones, which simply transmit data, to complex ones, which are equipped with the functionality of acknowledging receipt, or re-requesting a missing block of data.

This level provides the higher (application) level with two types of services:

  • Provides guaranteed delivery using the TCP protocol.
  • Delivers via UDP whenever possible .

To ensure guaranteed delivery, a connection is established according to the TCP protocol, which allows packets to be numbered at the output and acknowledged at the input. The numbering of packets and confirmation of reception is the so-called service information. This protocol supports transmission in "Duplex" mode. In addition, thanks to the well-thought-out regulations of the protocol, it is considered very reliable.

The UDP protocol is intended for moments when it is impossible to configure transmission via the TCP protocol, or you have to save on the network data transmission segment. Also, the UDP protocol can interact with higher-level protocols to increase the reliability of packet transmission.

Network layer or "Internet layer": the base layer for the entire TCP/IP model. The main functionality of this layer is identical to the layer of the same name in the OSI model and describes the movement of packets in a composite network consisting of several smaller subnets. It links adjacent layers of the TCP/IP protocol.

The network layer is the connecting layer between the higher transport layer and the lower level of network interfaces. The network layer uses protocols that receive a request from the transport layer, and through regulated addressing, transmit the processed request to the network interface protocol, indicating to which address to send the data.

The following TCP/IP network protocols are used at this level: ICMP, IP, RIP, OSPF. The main and most popular at the network level is, of course, the IP (Internet Protocol). Its main task is to transmit packets from one router to another until a unit of data reaches the network interface of the destination node. The IP protocol is deployed not only on hosts, but also on network equipment: routers and managed switches. The IP protocol operates on the principle of best-effort, non-guaranteed delivery. That is, there is no need to establish a connection in advance to send a packet. This option leads to saving traffic and time on the movement of unnecessary service packets. The packet is routed towards its destination, and it is possible that the node remains unreachable. In this case, an error message is returned.

Network interface level: is responsible for ensuring that subnetworks with different technologies can interact with each other and transmit information in the same mode. This is accomplished in two simple steps:

  • Encoding a packet into an intermediate network data unit.
  • Converts the destination information into the required subnet standards and sends the data unit.

This approach allows us to constantly expand the number of supported networking technologies. As soon as a new technology appears, it immediately falls into the TCP/IP protocol stack and allows networks with older technologies to transfer data to networks built using more modern standards and methods.

Units of data transferred

During the existence of such a phenomenon as the TCP/IP protocols, standard terms were established for the units of transmitted data. Data during transmission can be fragmented in different ways, depending on the technologies used by the destination network.

To have an idea of ​​what is happening with the data and at what point in time, it was necessary to come up with the following terminology:

  • Data stream- data that arrives at the transport layer from protocols of a higher application layer.
  • A segment is a fragment of data into which a stream is divided according to TCP protocol standards.
  • Datagram(especially illiterate people pronounce it as “Datagram”) - units of data that are obtained by splitting a stream using connectionless protocols (UDP).
  • Plastic bag- a unit of data produced via the IP protocol.
  • The TCP/IP protocols package IP packets into blocks of data transmitted over composite networks, called personnel or frames.

Types of TCP/IP protocol stack addresses

Any TCP/IP data transfer protocol uses one of the following address types to identify hosts:

  • Local (hardware) addresses.
  • Network addresses (IP addresses).
  • Domain names.

Local addresses (MAC addresses) - used in most local area network technologies to identify network interfaces. When talking about TCP/IP, the word local means an interface that operates not in a composite network, but within a separate subnet. For example, the subnet of an interface connected to the Internet will be local, and the Internet network will be composite. A local network can be built on any technology, and regardless of this, from the point of view of a composite network, a machine located in a separately dedicated subnet will be called local. Thus, when a packet enters the local network, its IP address is then associated with the local address, and the packet is sent to the MAC address of the network interface.

Network addresses (IP addresses). TCP/IP technology provides its own global addressing of nodes to solve a simple problem - combining networks with different technologies into one large data transmission structure. IP addressing is completely independent of the technology used on the local network, but an IP address allows a network interface to represent a machine on a composite network.

As a result, a system was developed in which hosts are assigned an IP address and a subnet mask. The subnet mask shows how many bits are allocated to the network number, and how many to the host number. An IP address consists of 32 bits, divided into blocks of 8 bits.

When a packet is transmitted, it is assigned information about the network number and the node number to which the packet should be sent. First, the router forwards the packet to the desired subnet, and then a host is selected that is waiting for it. This process is carried out by the Address Resolution Protocol (ARP).

Domain addresses on TCP/IP networks are managed by a specially designed Domain Name System (DNS). To do this, there are servers that match the domain name, presented as a string of text, with the IP address, and send the packet in accordance with global addressing. There is no correspondence between a computer name and an IP address, so in order to convert a domain name to an IP address, the sending device must access the routing table that is created on the DNS server. For example, we write the site address in the browser, the DNS server matches it with the IP address of the server on which the site is located, and the browser reads the information, receiving a response.

In addition to the Internet, it is possible to issue domain names to computers. Thus, the process of working on a local network is simplified. There is no need to remember all IP addresses. Instead, you can give each computer any name and use it.

IP address. Format. Components. Subnet mask

An IP address is a 32-bit number, which in traditional representation is written as numbers from 1 to 255, separated by dots.

Type of IP address in various recording formats:

  • Decimal IP address: 192.168.0.10.
  • Binary form of the same IP address: 11000000.10101000.00000000.00001010.
  • Address entry in hexadecimal number system: C0.A8.00.0A.

There is no separator between the network ID and the point number in the entry, but the computer is able to separate them. There are three ways to do this:

  1. Fixed border. With this method, the entire address is conditionally divided into two parts of a fixed length, byte by byte. Thus, if we give one byte for the network number, then we will get 2 8 networks of 2 24 nodes each. If the border is moved another byte to the right, then there will be more networks - 2 16, and fewer nodes - 2 16. Today, the approach is considered obsolete and is not used.
  2. Subnet mask. The mask is paired with an IP address. The mask has a sequence of values ​​"1" in those bits that are allocated to the network number, and a certain number of zeros in those places of the IP address that are allocated to the node number. The boundary between ones and zeros in the mask is the boundary between the network ID and the host ID in the IP address.
  3. Address classes method. Compromise method. When using it, network sizes cannot be selected by the user, but there are five classes - A, B, C, D, E. Three classes - A, B and C - are intended for various networks, and D and E are reserved for special-purpose networks . In a class system, each class has its own boundary of network number and node ID.

IP Address Classes

TO class A These include networks in which the network is identified by the first byte, and the remaining three are the node number. All IP addresses that have a first byte value from 1 to 126 in their range are class A networks. There are very few class A networks in quantity, but each of them can have up to 2 24 points.

Class B- networks in which the two highest bits are equal to 10. In them, 16 bits are allocated for the network number and point identifier. As a result, it turns out that the number of class B networks is quantitatively different from the number of class A networks, but they have a smaller number of nodes - up to 65,536 (2 16) units.

On networks class C- there are very few nodes - 2 8 in each, but the number of networks is huge, due to the fact that the network identifier in such structures takes up three bytes.

Networks class D- already belong to special networks. It starts with the sequence 1110 and is called a multicast address. Interfaces with class A, B and C addresses can be part of a group and receive a group address in addition to the individual one.

Addresses class E- in reserve for the future. Such addresses begin with the sequence 11110. Most likely, these addresses will be used as group addresses when there is a shortage of IP addresses on the global network.

Setting up the TCP/IP protocol

Setting up the TCP/IP protocol is available on all operating systems. These are Linux, CentOS, Mac OS X, Free BSD, Windows 7. The TCP/IP protocol only requires a network adapter. Of course, server operating systems are capable of more. The TCP/IP protocol is very widely configured using server services. IP addresses on regular desktop computers are set in the network connection settings. There you configure the network address, the gateway - the IP address of the point that has access to the global network, and the addresses of the points where the DNS server is located.

The TCP/IP Internet protocol can be configured manually. Although this is not always necessary. You can receive TCP/IP protocol parameters from the server's dynamic distribution address automatically. This method is used in large corporate networks. On a DHCP server, you can map a local address to a network address, and as soon as a machine with a given IP address appears on the network, the server will immediately give it a pre-prepared IP address. This process is called reservation.

TCP/IP Address Resolution Protocol

The only way to establish a relationship between a MAC address and an IP address is by maintaining a table. If there is a routing table, each network interface is aware of its addresses (local and network), but the question arises of how to properly organize the exchange of packets between nodes using the TCP/IP 4 protocol.

Why was Address Resolution Protocol (ARP) invented? In order to link the TCP/IP family of protocols and other addressing systems. An ARP mapping table is created on each node and is populated by polling the entire network. This happens every time the computer is turned off.

ARP table

This is what an example of a compiled ARP table looks like.

After nine months of development, the FFmpeg 4.2 multimedia package is available, which includes a set of applications and a collection of libraries for operations on various multimedia formats (recording, converting and […]

Linux Mint 19.2 is a long-term support release that will be supported until 2023. It comes with updated software and contains improvements and many new […]

  • Linux Mint 19.2 distribution released

    Presented is the release of the Linux Mint 19.2 distribution, the second update of the Linux Mint 19.x branch, formed on the Ubuntu 18.04 LTS package base and supported until 2023. The distribution is fully compatible [...]

  • New BIND service releases are available that contain bug fixes and feature improvements. New releases can be downloaded from the downloads page on the developer's website: […]

    Exim is a message transfer agent (MTA) developed at the University of Cambridge for use on Unix systems connected to the Internet. It is freely available in accordance with [...]

    After almost two years of development, the release of ZFS on Linux 0.8.0 is presented, an implementation of the ZFS file system, designed as a module for the Linux kernel. The module has been tested with Linux kernels from 2.6.32 to […]

  • WordPress 5.1.1 has fixed a vulnerability that could allow you to take control of your site.
  • The IETF (Internet Engineering Task Force), which develops Internet protocols and architecture, has completed an RFC for the ACME (Automatic Certificate Management Environment) protocol […]

    The non-profit certification authority Let’s Encrypt, which is controlled by the community and provides certificates free of charge to everyone, summed up the results of the past year and talked about plans for 2019. […]

  • A new version of Libreoffice has been released – Libreoffice 6.2

    The Document Foundation announced the release of LibreOffice 6.2. Changes and additions in the new release: Libreoffice Writer The ability to hide changes has been reworked: edit ▸ change track ▸ show […]

  • IP addresses (Internet Protocol version 4, Internet Protocol version 4) - are the main type of addresses used at the network layer of the OSI model to transmit packets between networks. IP addresses consist of four bytes, for example 192.168.100.111.

    Assignment of IP addresses to hosts is carried out:

    • manually, configured by the system administrator during network setup;
    • automatically, using special protocols (in particular, using the DHCP protocol - Dynamic Host Configuration Protocol, dynamic host configuration protocol).

    IPv4 protocol developed in September 1981.

    IPv4 protocol operates at the internetwork (network) level of the TCP/IP protocol stack. The main task of the protocol is to transfer blocks of data (datagrams) from the sending host to the destination host, where the senders and recipients are computers uniquely identified by fixed-length addresses (IP addresses). Also, the Internet Protocol IP carries out, if necessary, fragmentation and collection of sent datagrams for data transmission through other networks with smaller packet sizes.

    The disadvantage of the IP protocol is the unreliability of the protocol, that is, before the start of transmission, a connection is not established, this means that the delivery of packets is not confirmed, the correctness of the received data is not monitored (using a checksum) and the acknowledgment operation is not performed (exchange of service messages with the node -destination and its readiness to receive packages).

    The IP protocol sends and processes each datagram as an independent piece of data, that is, without any other connections to other datagrams on the global Internet.

    After sending a datagram via IP to the network, further actions with this datagram are in no way controlled by the sender. It turns out that if a datagram, for some reason, cannot be transmitted further over the network, it is destroyed. Although the node that destroyed the datagram has the opportunity to report the reason for the failure to the sender, via the return address (in particular, using the ICMP protocol). The guarantee of data delivery is entrusted to higher-level protocols (transport layer), which are endowed with special mechanisms for this (TCP protocol).

    As you know, routers operate at the network layer of the OSI model. Therefore, one of the most basic tasks of the IP protocol is the implementation of datagram routing, in other words, determining the optimal path for datagrams (using routing algorithms) from the sending node of the network to any other node on the network based on the IP address.

    On any network node receiving a datagram from the network looks like this:

    IP Header Format

    The structure of IP packets version 4 is shown in the figure

    • Version - for IPv4 the field value should be 4.
    • IHL - (Internet Header Length) the length of the IP packet header in 32-bit words (dword). It is this field that indicates the beginning of the data block in the packet. The minimum valid value for this field is 5.
    • Type of Service (TOS acronym) - a byte containing a set of criteria that determines the type of service for IP packets, shown in the figure.

    Description of the service byte bit by bit:

      • 0-2 - priority (precedence) of this IP segment
      • 3 - requirement for delay time of IP segment transmission (0 - normal, 1 - low delay)
      • 4 - throughput requirement of the route along which the IP segment should be sent (0 - low, 1 - high throughput)
      • 5 - requirement for reliability (reliability) of IP segment transmission (0 - normal, 1 - high reliability)
      • 6-7 - ECN - explicit delay message (IP flow control).
    • Packet Length - The length of the packet in octets, including header and data. The minimum valid value for this field is 20, the maximum is 65535.
    • Identifier is a value assigned by the sender of the package and is intended to determine the correct sequence of fragments when assembling the package. For a fragmented packet, all fragments have the same ID.
    • 3 flag bits. The first bit must always be zero, the second bit DF (don’t fragment) determines whether the packet can be fragmented, and the third bit MF (more fragments) indicates whether this packet is the last in a chain of packets.
    • Fragment offset is a value that determines the position of the fragment in the data stream. The offset is specified by the number of eight byte blocks, so this value must be multiplied by 8 to convert to bytes.
    • Time to Live (TTL) is the number of routers this packet must pass through. As the router passes, this number will decrease by one. If the value of this field is zero, then the packet MUST be discarded and a Time Exceeded message (ICMP code 11 type 0) may be sent to the sender of the packet.
    • Protocol - The next layer Internet protocol identifier indicates which protocol data the packet contains, such as TCP or ICMP.
    • Header checksum - calculated according to RFC 1071

    Intercepted IPv4 packet using Wireshark sniffer:

    IP packet fragmentation

    On the path of a packet from the sender to the recipient, there may be local and global networks of different types with different allowable sizes of data fields of link-level frames (Maximum Transfer Unit - MTU). Thus, Ethernet networks can transmit frames carrying up to 1500 bytes of data, X.25 networks are characterized by a frame data field size of 128 bytes, FDDI networks can transmit frames of 4500 bytes in size, and other networks have their own limitations. The IP protocol is able to transmit datagrams whose length is greater than the MTU of the intermediate network, due to fragmentation - breaking up a “large packet” into a number of parts (fragments), the size of each of which satisfies the intermediate network. After all the fragments have been transmitted through the intermediate network, they will be collected at the recipient node by the IP protocol module back into a “big packet”. Note that the packet is assembled from fragments only by the recipient, and not by any of the intermediate routers. Routers can only fragment packets, not reassemble them. This is because different fragments of the same packet will not necessarily pass through the same routers.

    In order not to confuse fragments of different packets, the Identification field is used, the value of which must be the same for all fragments of one packet and not repeated for different packets until the lifetime of both packets has expired. When dividing packet data, the size of all fragments except the last one must be a multiple of 8 bytes. This allows you to allocate less space in the header to the Fragment offset field.

    The second bit of the More fragments field, if equal to one, indicates that this fragment is not the last in the packet. If the packet is sent without fragmentation, the “More fragments” flag is set to 0, and the Fragment Offset field is filled with zero bits.

    If the first bit of the Flags field (Don’t fragment) is equal to one, then fragmentation of the packet is prohibited. If this packet were to be sent over a network with an insufficient MTU, the router would be forced to discard it (and report this to the sender via ICMP). This flag is used in cases where the sender knows that the recipient does not have enough resources to reconstruct packets from fragments.

    All IP addresses can be divided into two logical parts - network numbers and network node numbers (host number). To determine which part of the IP address belongs to the network number and which part belongs to the host number, it is determined by the values ​​of the first bits of the address. Also, the first bits of an IP address are used to determine which class a particular IP address belongs to.

    The figure shows the structure of the IP address of different classes.

    If the address starts with 0, then the network is classified as class A and the network number occupies one byte, the remaining 3 bytes are interpreted as the node number in the network. Class A networks have numbers ranging from 1 to 126. (Number 0 is not used, and number 127 is reserved for special purposes, as will be discussed below.) Class A networks are few, but the number of nodes in them can reach 2 24, that is 16,777,216 knots.

    If the first two bits of the address are equal to 10, then the network belongs to class B. In class B networks, 16 bits, that is, 2 bytes, are allocated for the network number and the node number. Thus, a class B network is a medium-sized network with a maximum number of nodes of 2 16, which is 65,536 nodes.

    If the address begins with the sequence 110, then this is a class C network. In this case, 24 bits are allocated for the network number, and 8 bits for the node number. Networks of this class are the most common; the number of nodes in them is limited to 2 8, that is, 256 nodes.

    If the address begins with the sequence 1110, then it is a class D address and denotes a special, multicast address. If a packet contains a class D address as a destination address, then all nodes to which this address is assigned must receive such a packet.

    If the address begins with the sequence 11110, then this means that this address belongs to class E. Addresses of this class are reserved for future use.

    The table shows the ranges of network numbers and the maximum number of nodes corresponding to each network class.

    Large networks receive Class A addresses, medium-sized networks receive Class B addresses, and small networks receive Class C addresses.

    Using masks in IP addressing

    In order to obtain a particular range of IP addresses, enterprises were asked to fill out a registration form, which listed the current number of computers and the planned increase in the number of computers, and as a result, the enterprise was given a class of IP addresses: A, B, C, depending on the specified data in the registration form.

    This mechanism for issuing IP address ranges worked normally, this was due to the fact that at first organizations had a small number of computers and, accordingly, small computer networks. But due to the further rapid growth of the Internet and network technologies, the described approach to the distribution of IP addresses began to produce failures, mainly associated with class “B” networks. Indeed, organizations in which the number of computers did not exceed several hundred (say, 500) had to register for themselves an entire class “B” network (since class “C” is only for 254 computers, and class “B” is for 65534). Because of this, there simply weren’t enough available Class B networks, but at the same time large ranges of IP addresses were wasted.

    The traditional scheme of dividing an IP address into a network number (NetID) and a host number (HostID) is based on the concept of a class, which is determined by the values ​​of the first few bits of the address. It is precisely because the first byte of the address 185.23.44.206 falls in the range 128-191 that we can say that this address belongs to class B, which means that the network number is the first two bytes, supplemented by two zero bytes - 185.23.0.0, and the number node - 0.0.44.206.

    What if we used some other feature that could be used to more flexibly set the boundary between the network number and the node number? Masks are now widely used as such a sign.

    Mask- this is the number that is used in conjunction with the IP address; The binary mask entry contains ones in those bits that should be interpreted as a network number in the IP address. Since the network number is an integral part of the address, the ones in the mask must also represent a continuous sequence.

    For standard network classes, masks have the following meanings:

    • class A - 11111111.00000000.00000000.00000000 (255.0.0.0);
    • class B - 11111111. 11111111. 00000000. 00000000 (255.255.0.0);
    • class C - 11111111. 11111111.11111111. 00000000 (255.255.255.0).

    By providing each IP address with a mask, you can abandon the concept of address classes and make the addressing system more flexible. For example, if the address 185.23.44.206 discussed above is associated with a mask 255.255.255.0, then the network number will be 185.23.44.0, and not 185.23.0.0, as defined by the class system.

    Calculation of network number and node number using mask:

    In masks, the number of ones in the sequence that defines the boundary of the network number does not have to be a multiple of 8 in order to repeat the division of the address into bytes. Let, for example, for the IP address 129.64.134.5 the mask 255.255.128.0 is specified, that is, in binary form:

    • IP address 129.64.134.5 - 10000001. 01000000.10000110. 00000101
    • Mask 255.255.128.0 - 11111111.11111111.10000000. 00000000

    If you ignore the mask, then, in accordance with the class system, the address 129.64.134.5 belongs to class B, which means that the network number is the first 2 bytes - 129.64.0.0, and the node number is 0.0.134.5.

    If you use a mask to determine the boundary of the network number, then 17 consecutive units in the mask, “superimposed” (logical multiplication) on the IP address, determine the number as the network number in binary expression:

    or in decimal notation - the network number is 129.64.128.0, and the node number is 0.0.6.5.

    There is also a short version of mask notation called prefix or a short mask. In particular, the network 80.255.147.32 with a mask of 255.255.255.252 can be written as 80.255.147.32/30, where “/30” indicates the number of binary units in the mask, that is, thirty binary units (counted from left to right).

    For clarity, the table shows the correspondence between the prefix and the mask:

    The mask mechanism is widespread in IP routing, and masks can be used for a variety of purposes. With their help, the administrator can structure his network without requiring additional network numbers from the service provider. Based on the same mechanism, service providers can combine address spaces of several networks by introducing so-called “ prefixes"in order to reduce the size of routing tables and thereby increase the performance of routers. In addition, writing a mask as a prefix is ​​much shorter.

    Special IP addresses

    The IP protocol has several conventions for interpreting IP addresses differently:

    • 0.0.0.0 - represents the default gateway address, i.e. the address of the computer to which information packets should be sent if they did not find a destination in the local network (routing table);
    • 255.255.255.255 – broadcast address. Messages sent to this address are received by all nodes of the local network containing the computer that is the source of the message (it is not transmitted to other local networks);
    • “Network number.” “all zeros” – network address (for example 192.168.10.0);
    • “All zeros.” “node number” – a node in this network (for example 0.0.0.23). Can be used to transmit messages to a specific node within a local network;
    • If the destination node number field contains only ones, then a packet with such an address is sent to all network nodes with the given network number. For example, a packet with the address 192.190.21.255 is delivered to all nodes on the network 192.190.21.0. This type of distribution is called a broadcast message. When addressing, it is necessary to take into account the restrictions that are introduced by the special purpose of some IP addresses. Thus, neither the network number nor the node number can consist of only binary ones or only binary zeros. It follows that the maximum number of nodes given in the table for networks of each class, in practice, should be reduced by 2. For example, in class C networks, 8 bits are allocated for the node number, which allows you to set 256 numbers: from 0 to 255. However, In practice, the maximum number of nodes in a class C network cannot exceed 254, since addresses 0 and 255 have a special purpose. From the same considerations, it follows that the end node cannot have an address like 98.255.255.255, since the node number in this class A address consists of only binary ones.
    • The IP address has a special meaning, the first octet of which is 127.x.x.x. It is used to test programs and process interactions within the same machine. When a program sends data to the IP address 127.0.0.1, a “loop” is formed. Data is not transmitted over the network, but is returned to upper-level modules as just received. Therefore, on an IP network, it is prohibited to assign IP addresses to machines starting with 127. This address is called loopback. You can assign the address 127.0.0.0 to the internal network of the host routing module, and the address 127.0.0.1 to the address of this module on the internal network. In fact, any network address 127.0.0.0 serves to designate its routing module, and not just 127.0.0.1, for example 127.0.0.3.

    The IP protocol does not have the concept of broadcasting in the sense in which it is used in link-layer protocols of local networks, when data must be delivered to absolutely all nodes. Both the restricted broadcast IP address and the broadcast IP address have Internet propagation limits - they are limited either to the network to which the source host of the packet belongs, or to the network whose number is specified in the destination address. Therefore, dividing the network into parts using routers localizes the broadcast storm to the boundaries of one of the parts that make up the overall network, simply because there is no way to simultaneously address the packet to all nodes of all networks of the composite network.

    IP addresses used in local networks

    All addresses used on the Internet must be registered, which guarantees their uniqueness on a global scale. These addresses are called real or public IP addresses.

    For local networks not connected to the Internet, registration of IP addresses is naturally not required, since, in principle, any possible addresses can be used here. However, in order to avoid the possibility of conflicts when such a network is subsequently connected to the Internet, it is recommended to use only the following ranges of so-called private IP addresses on local networks (these addresses do not exist on the Internet and it is not possible to use them there), presented in the table.

    TCP/IP protocols are the basis of the global Internet. To be more precise, TCP/IP is a list or stack of protocols, and in fact, a set of rules by which information is exchanged (the packet switching model is implemented).

    In this article, we will analyze the principles of operation of the TCP/IP protocol stack and try to understand the principles of their operation.

    Note: Often, the abbreviation TCP/IP refers to the entire network operating on the basis of these two protocols, TCP and IP.

    In the model of such a network, in addition to the main protocols TCP (Transport Layer) and IP (Network Layer Protocol) includes application and network layer protocols (see photo). But let's return directly to the TCP and IP protocols.

    What are TCP/IP protocols

    TCP - Transfer Control Protocol. Transmission Control Protocol. It serves to ensure and establish a reliable connection between two devices and reliable data transfer. In this case, the TCP protocol controls the optimal size of the transmitted data packet, sending a new one if the transmission fails.

    IP - Internet Protocol. The Internet Protocol or Address Protocol is the basis of the entire data transmission architecture. The IP protocol is used to deliver a network data packet to the desired address. In this case, the information is divided into packets, which independently move through the network to the desired destination.

    TCP/IP protocol formats

    IP protocol format

    There are two formats for IP protocol IP addresses.

    IPv4 format. This is a 32-bit binary number. A convenient form of writing an IP address (IPv4) is as four groups of decimal numbers (from 0 to 255), separated by periods. For example: 193.178.0.1.

    IPv6 format. This is a 128-bit binary number. As a rule, IPv6 addresses are written in the form of eight groups. Each group contains four hexadecimal digits separated by a colon. Example IPv6 address 2001:0db8:85a3:08d3:1319:8a2e:0370:7889.

    How TCP/IP protocols work

    If it’s convenient, think of transmitting data packets on the network as sending a letter by mail.

    If it’s inconvenient, imagine two computers connected by a network. Moreover, the connection network can be any, both local and global. There is no difference in the principle of data transfer. A computer on a network can also be considered a host or node.

    IP protocol

    Each computer on the network has its own unique address. On the global Internet, a computer has this address, which is called an IP address (Internet Protocol Address).

    By analogy with mail, an IP address is a house number. But the house number is not enough to receive a letter.

    Information transmitted over the network is transmitted not by the computer itself, but by applications installed on it. Such applications are mail server, web server, FTP, etc. To identify the packet of transmitted information, each application is attached to a specific port. For example: web server listens on port 80, FTP listens on port 21, SMTP mail server listens on port 25, POP3 server reads mailbox mail on port 110.

    Thus, in the address packet in the TCP/IP protocol, another line appears in the addressees: port. Analogue with mail - the port is the apartment number of the sender and the recipient.

    Example:

    Source address:

    IP: 82.146.47.66

    Destination address:

    IP: 195.34.31.236

    It’s worth remembering: IP address + port number is called a “socket”. In the example above: from socket 82.146.47.66:2049 a packet is sent to socket 195.34.31.236:53.

    TCP protocol

    The TCP protocol is the next layer protocol after the IP protocol. This protocol is intended to control the transfer of information and its integrity.

    For example, the transmitted information is divided into separate packets. The packages will be delivered to the recipient independently. During the transmission process, one of the packets was not transmitted. The TCP protocol provides retransmissions until the recipient receives the packet.

    The TCP transport protocol hides all problems and details of data transfer from higher-level protocols (physical, channel, network IP).

    Interaction between computers on the Internet is carried out through network protocols, which are an agreed upon set of specific rules according to which different data transmission devices exchange information. There are protocols for error control formats and other types of protocols. The most commonly used protocol in global internetworking is TCP-IP.

    What kind of technology is this? The name TCP-IP comes from two network protocols: TCP and IP. Of course, the construction of networks is not limited to these two protocols, but they are basic as far as the organization of data transmission is concerned. In fact, TCP-IP is a set of protocols that allows individual networks to come together to form

    The TCP-IP protocol, which cannot be described only by the definitions of IP and TCP, also includes the protocols UDP, SMTP, ICMP, FTP, telnet, and more. These and other TCP-IP protocols provide the most complete operation of the Internet.

    Below we provide a detailed description of each protocol included in the general concept of TCP-IP.

    . Internet protocol(IP) is responsible for the direct transmission of information on the network. The information is divided into parts (in other words, packets) and transmitted to the recipient from the sender. For accurate addressing, you need to specify the exact address or coordinates of the recipient. Such addresses consist of four bytes, which are separated from each other by dots. Each computer's address is unique.

    However, using the IP protocol alone may not be enough for correct data transmission, since the volume of most of the transmitted information is more than 1500 characters, which no longer fits into one packet, and some packets may be lost during transmission or sent in the wrong order, what is needed.

    . Transmission Control Protocol(TCP) is used at a higher level than the previous one. Based on the IP protocol's ability to carry information from one host to another, the TCP protocol allows large amounts of information to be sent. TCP is also responsible for dividing transmitted information into separate parts - packets - and correctly recovering data from packets received after transmission. In this case, this protocol automatically repeats the transmission of packets that contain errors.

    Management of the organization of data transfer in large volumes can be carried out using a number of protocols that have special functional purposes. In particular, there are the following types of TCP protocols.

    1. FTP(File Transfer Protocol) organizes file transfer and is used to transfer information between two Internet nodes using TCP connections in the form of a binary or simple text file, as a named area in computer memory. In this case, it does not matter where these nodes are located and how they are connected to each other.

    2. User Datagram Protocol, or User Datagram Protocol, is connection independent and transmits data in packets called UDP datagrams. However, this protocol is not as reliable as TCP because the sender does not know whether the packet was actually received.

    3. ICMP(Internet Control Message Protocol) exists to transmit error messages that occur during data exchange on the Internet. However, the ICMP protocol only reports errors, but does not eliminate the reasons that led to these errors.

    4. Telnet- which is used to implement a text interface on a network using the TCP transport.

    5. SMTP(Simple Mail Transfer Protocol) is a special electronic message that defines the format of messages that are sent from one computer, called an SMTP client, to another computer running an SMTP server. In this case, this transfer can be delayed for some time until the work of both the client and the server is activated.

    Data transmission scheme via TCP-IP protocol

    1. The TCP protocol breaks the entire amount of data into packets and numbers them, packing them into TCP envelopes, which allows you to restore the order in which parts of information are received. When data is placed in such an envelope, a checksum is calculated, which is then written into the TCP header.

    3. TCP then checks to see if all packets have been received. If, during reception, the newly calculated one does not coincide with that indicated on the envelope, this indicates that some of the information was lost or distorted during transmission, the TCP-IP protocol again requests the forwarding of this packet. Confirmation of the receipt of data from the recipient is also required.

    4. After confirming the receipt of all packets, the TCP protocol orders them accordingly and reassembles them into a single whole.

    The TCP protocol uses repeated data transmissions and waiting periods (or timeouts) to ensure reliable delivery of information. Packets can be transmitted in two directions simultaneously.

    Thus, TCP-IP eliminates the need for retransmissions and waits for application processes (such as Telnet and FTP).

    views