Setting up a tcp ip connection at the software level. More in the Linux Basics category

StackTCP/ IP.

The TCP/IP stack is a set of hierarchically ordered network protocols. The stack is named after two important protocols – TCP (Transmission Control Protocol) and IP (Internet Protocol). In addition to them, the stack includes several dozen more different protocols. Currently, TCP/IP protocols are the main ones for the Internet, as well as for most corporate and local networks.

In the Microsoft Windows Server 2003 operating system, the TCP/IP stack is selected as the main one, although other protocols are also supported (for example, the IPX/SPX stack, the NetBIOS protocol).

The TCP/IP protocol stack has two important properties:

    platform independence, i.e. its implementation is possible on a wide variety of operating systems and processors;

    openness, i.e. the standards by which the TCP/IP stack is built are available to anyone.

History of creationTCP/ IP.

In 1967, the Advanced Research Projects Agency of the US Department of Defense (ARPA - Advanced Research Projects Agency) initiated the development of a computer network that was supposed to connect a number of universities and research centers that carried out orders from the Agency. The project was called ARPANET. By 1972, the network connected 30 nodes.

As part of the ARPANET project, the main protocols of the TCP/IP stack - IP, TCP and UDP - were developed and published in 1980–1981. An important factor in the spread of TCP/IP was the implementation of this stack in the UNIX 4.2 BSD operating system (1983).

By the end of the 80s, the significantly expanded ARPANET network became known as the Internet (Interconnected networks) and united universities and research centers in the USA, Canada and Europe.

In 1992, a new Internet service appeared - WWW (World Wide Web), based on the HTTP protocol. Largely thanks to WWW, the Internet, and with it the TCP/IP protocols, received rapid development in the 90s.

At the beginning of the 21st century, the TCP/IP stack is acquiring a leading role in the means of communication not only of global, but also local networks.

ModelOSI.

The Open Systems Interconnection (OSI) model was developed by the International Organization for Standardization (ISO) to provide a consistent approach to building and interconnecting networks. Development of the OSI model began in 1977 and ended in 1984 with the approval of the standard. Since then, the model has been the reference for the development, description and comparison of various protocol stacks.

Let's briefly look at the functions of each level.


The OSI model includes seven layers: physical, data link, network, transport, session, presentation, and application.

    The physical layer describes the principles of signal transmission, transmission speed, and specifications of communication channels. The layer is implemented by hardware (network adapter, hub port, network cable).

    The data link layer solves two main tasks: it checks the availability of the transmission medium (the transmission medium is most often divided between several network nodes), and also detects and corrects errors that occur during the transmission process.

    The implementation of the level is software and hardware (for example, a network adapter and its driver). The network layer ensures the integration of networks operating using different protocols of the data link and physical layers into a composite network. In this case, each of the networks included in a single network is called subnet (subnet). At the network level, two main problems have to be solved: routing(routing, choosing the optimal path for transmitting a message) and addressing(addressing, each node in a composite network must have a unique name). Typically, network layer functions are implemented by a special device -

    router

    (router) and its software.

    The transport layer solves the problem of reliably transmitting messages in a composite network by confirming delivery and resending packets. This level and all the following are implemented in software.

    The session layer allows you to remember information about the current state of a communication session and, in the event of a connection break, resume the session from this state.

The presentation layer ensures the conversion of transmitted information from one encoding to another (for example, from ASCII to EBCDIC).TCP/ IP. The TCP/IP structure is not based on the OSI model, but on its own model, called DARPA (Defense ARPA - the new name of the Advanced Research Projects Agency) or DoD (Department of Defense - US Department of Defense). This model has only four levels. The correspondence of the OSI model to the DARPA model, as well as the main protocols of the TCP/IP stack, is shown in Fig. 2.2.

It should be noted that the lower level of the DARPA model - the network interface level - strictly speaking, does not perform the functions of the data link and physical layers, but only provides communication (interface) of the upper DARPA levels with the network technologies included in the composite network (for example, Ethernet, FDDI, ATM ).

All protocols included in the TCP/IP stack are standardized in RFC documents.

DocumentationRFC.

Approved official Internet and TCP/IP standards are published as RFC (Request for Comments) documents. Standards are developed by the entire ISOC community (Internet Society, an international public organization). Any ISOC member may submit a document for consideration for publication in an RFC. The document is then reviewed by technical experts, development teams and the RFC editor and goes through the following stages, called maturity levels, in accordance with RFC 2026:

    draft(Internet Draft) – at this stage, experts familiarize themselves with the document, additions and changes are made;

    proposed standard(Proposed Standard) - the document is assigned an RFC number, experts have confirmed the viability of the proposed solutions, the document is considered promising, it is desirable that it be tested in practice;

    draft standard(Draft Standard) - a document becomes a draft standard if at least two independent developers have implemented and successfully applied the proposed specifications.

    At this stage, minor corrections and improvements are still allowed; Internet standard

(Internet Standard) - the highest stage of approval of the standard, the document specifications have become widespread and have proven themselves in practice. A list of Internet standards is given in RFC 3700. Of the thousands of RFCs, only a few dozen are documents with the status of “Internet standard”.

    experimental(Experimental) - a document containing information about scientific research and development that may be of interest to ISOC members;

    informational(Informational) - a document published to provide information and does not require approval by the ISOC community;

    best modern experience(Best Current Practice) - a document intended to convey experience from specific developments, such as protocol implementations.

The status is indicated in the header of the RFC document after the word Category (Category). For documents in the status of standards (Proposed Standard, Draft Standard, Internet Standard), the name is indicated Standards Track, since the level of readiness may vary.

RFC numbers are assigned sequentially and are never reissued. The original RFC is never updated. The updated version is published under a new number. An obsolete and superseded RFC becomes historical(Historic).

All existing RFC documents can be viewed, for example, on the website www.rfc-editor.org . There were over 5,000 in August 2007. The RFCs referenced in this course are listed in Appendix I.

Overview of the main protocols.

Protocol IP (Internet Protocol) – This is the main network layer protocol responsible for addressing in composite networks and packet transmission between networks. The IP protocol is datagram protocol, i.e. it does not guarantee delivery of packets to the destination node. The transport layer protocol TCP provides guarantees.

Protocols R.I.P. (Routing Information Protocol routing information protocol ) AndOSPF (Open Shortest Path First – « The shortest routes open first" ) – routing protocols in IP networks.

Protocol ICMP (Internet Control Message Protocol Control Message Protocol in Composite Networks) is designed to exchange error information between network routers and the source node of the packet. Using special packets, it reports the impossibility of delivering a package, the duration of assembling a package from fragments, anomalous parameter values, changes in the forwarding route and type of service, the state of the system, etc.

Protocol ARP (Address Resolution Protocol – Address Translation Protocol) converts IP addresses into hardware addresses of local networks. The reverse conversion is carried out using the protocol RAPR (Reverse ARP).

TCP (Transmission Control Protocol – transmission control protocol) ensures reliable transmission of messages between remote network nodes through the formation of logical connections. TCP allows you to deliver a byte stream generated on one of the computers to any other computer included in the composite network without errors. TCP divides the byte stream into parts - segments and passes them on to the network layer. Once these segments are delivered to their destination, TCP reassembles them into a continuous stream of bytes.

UDP (User Datagram Protocol – User Datagram Protocol) provides data transmission in a datagram manner.

HTTP (HyperText Transfer Protocol – hypertext transfer protocol) – web document delivery protocol, the main protocol of the WWW service.

FTP (File Transfer Protocol – file transfer protocol) – a protocol for transferring information stored in files.

POP 3 (Post Office Protocol version 3 – post office protocol) and SMTP (Simple Mail Transfer Protocol – Simple Mail Forwarding Protocol) – protocols for delivering incoming email (POP3) and sending outgoing email (SMTP).

Telnet – terminal emulation protocol 1, allowing the user to connect to other remote stations and work with them from their machine, as if it were their remote terminal.

SNMP (Simple Network Management Protocol – simple network management protocol) is designed to diagnose the performance of various network devices.


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 TCP/IP abbreviation 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 sending data packets over 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.

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 protocol most commonly used 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).

The main thing that distinguishes the Internet from other networks is its protocols - TCP/IP. In general, the term TCP/IP usually means everything related to protocols for communication between computers on the Internet. It covers an entire family of protocols, application programs, and even the network itself. TCP/IP is an internetworking technology. A network that uses TCP/IP technology is called "internet". If we are talking about a global network that connects many networks with TCP/IP technology, then it is called the Internet.

The TCP/IP protocol gets its name from two communication protocols (or communication protocols). These are Transmission Control Protocol (TCP) and Internet Protocol (IP). Although the Internet uses a large number of other protocols, the Internet is often called TCP/1P-network, since these two protocols are certainly the most important.

The IP (Internet Protocol) protocol manages the direct transmission of information over the network. All information is divided into parts - packages and is sent from the sender to the recipient. In order to accurately address the package, it is necessary to specify clear coordinates of the recipient or his address.

Internet address consists of 4 bytes. When writing, the bytes are separated from each other by dots: 123.45.67.89 or 3.33.33.3. In reality, an address consists of several parts. Since the Internet is a network of networks, the beginning of an address tells Internet nodes which network the address is part of. The right end of the address tells this network which computer or host should receive the packet. Each computer on the Internet has a unique address in this scheme.

Computer numeric address on the Internet is similar to a post office postal code. There are several types of Internet addresses (types: A, B, C, D, E), which divide the address in different ways into fields of network number and node number; the number of possible networks and machines in such networks depends on the type of such division.

Due to hardware limitations, information sent over IP networks is divided into parts (along byte boundaries), laid out into separate packages. The length of information inside a packet usually ranges from 1 to 1500 bytes. This protects the network from monopolization by any user and gives everyone approximately equal rights. For the same reason, if the network is not fast enough, the more users using it at the same time, the slower it will communicate with everyone.

One of the advantages of the Internet is that the IP protocol itself is already quite sufficient to operate. However, this protocol also has a number of disadvantages:

  • - most of the transmitted information is longer than 1500 characters, so it has to be divided into several packets;
  • - some packets may be lost along the way;
  • - packets may arrive in a sequence different from the initial one.

The protocols used must provide ways to transfer large amounts of information without distortion that may occur due to the fault of the network.

Transmission Control Protocol (TCP) is a protocol closely related to IP that is used for similar purposes, but at a higher level. The TCP protocol deals with the problem of sending large amounts of information, based on the capabilities of the IP protocol.

TCP divides the information to be sent into several parts and numbers each part so that the order can be restored later. To send this numbering along with the data, it covers each piece of information with its own cover - a TCP envelope that contains the corresponding information.

Upon receipt, the recipient unpacks the IP envelopes and sees the TCP envelopes, unpacks them too and places the data in a sequence of parts in the appropriate place. If something is missing, he demands that this piece be sent again. In the end, the information is collected in the right order and completely restored.

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 enable the user to interact 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 confirmed 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) pieces.

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, in addition to the individual address, a group address.

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 dynamically distributing server address in automatic mode. 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.