• 3 protocols tcp ip http. What is TCP-IP protocol

    Introduction. 1

    OSI 2 reference model

    Anatomy of the TCP/IP model. 4

    Application layer . 4

    Inter-host level . 4

    Internet layer . 4

    Level network access . 5

    Advantages of TCP/IP. 5

    Levels and protocols TCP / IP . 6

    TCP/IP model. 6

    TCP/IP protocol family. 6

    IP protocol. 7

    Protocol Objectives IP . 8

    TCP protocol. 8

    TCP Protocol Objectives . 8

    UDP protocol. 8

    Protocol Objectives UDP . 9

    World Wide Web. 14

    Conclusion. 17

    Application. 19

    List of used literature... 20

    Introduction

    In general, the term TCP/IP refers to a whole family of protocols: TCP (Transmission Control Protocol/Internet Protocol) for reliable data delivery, UDP (User Datagram Protocol) for non-guaranteed delivery, IP (Internet Protocol) and other application services.

    TCP/IP is an open communication protocol. Openness means that it enables communication across any combination of devices, no matter how different they may be. physical level.

    The TCP/IP protocol made the Internet what it is today. As a result, the Internet has revolutionized the way we live and work almost as much as the printing press, electricity, and the computer. Without popular protocols and services - such as HTTP, SMTP and FTP - the Internet would simply be a large number computers tied into a useless tangle.

    The TCP/IP protocol is ubiquitous. This is a family of protocols that allows anyone with a computer, a modem, and a contract with an Internet Service Provider to access information throughout the Internet. Users of AOL Instant Messenger and ICQ (also owned by AOL) receive and send over 750 million messages per day.

    TCP/IP is the reason many millions of transactions are completed every day—perhaps billions, since the Internet is not limited to email and messaging. Moreover, TCP/IP is not going to give up its position in the near future. This is a stable, well-developed and fairly complete family of protocols.

    In my course work I describe general overview families of TCP/IP protocols, basic principles of their operation and tasks, brief history World Wide Web and HTTP.

    OSI reference model

    The International Organization for Standardization (ISO) has developed a reference model for interoperability open systems(OSI, Open Systems Interconnection) in 1978/1979 to facilitate open communication between computer systems. Open is interoperability that can be supported across heterogeneous environments containing systems from different vendors. The OSI model establishes a global standard that defines the composition of functional layers when open interaction between computers.

    It should be noted that the model was so successful in achieving its original goals that at present its merits are practically not discussed. The previously closed, integrated approach is no longer used in practice; nowadays, open communication is mandatory. Oddly enough, very few products fully comply with the OSI standard. Instead, the basic layered structure is often adapted to new standards. However, the OSI reference model remains a valuable tool for demonstrating how a network works.

    Reference model TCP / IP

    Unlike reference model OSI, TCP/IP model to a greater extent focuses on ensuring network interactions rather than strictly separating functional levels. For this purpose, it recognizes the importance of the hierarchical structure of functions, but provides protocol designers with sufficient flexibility in implementation. Accordingly, the OSI reference model is much better suited to explain the mechanics of computer-to-computer communications, but TCP/IP has become the primary internetworking protocol.

    Flexibility of the TCP/IP reference model compared to the reference model OSI model shown in the figure.

    Anatomy of the TCP/IP model

    The TCP/IP protocol stack consists of four functional layers: application, host-to-host, internetwork, and network access layers.

    Application layer

    The application layer contains remote access protocols and sharing resources. Familiar applications - such as Telnet, FTP, SMTP, HTTP and many others - operate at this level and depend on the functionality of the levels lower in the hierarchy. Any application that uses IP networks (including amateur and commercial programs) belongs to this level of the model.

    Inter-host level

    Functions of this layer include segmenting data in applications for forwarding over the network, performing mathematical checks on the integrity of received data, and multiplexing data streams (both transmitted and received) for multiple applications simultaneously. It follows that the host-to-host layer has a means of identifying applications and is able to reorder data received in the wrong order.

    Currently, the host-to-host layer consists of two protocols: the TCP Transmission Control Protocol and the UDP User Datagram Protocol. With the Internet becoming increasingly transaction-oriented, a third protocol was defined, tentatively called the Transaction/Transmission Control Protocol (T/TCP). However, in most application services The Internet uses TCP and UDP protocols at the host-to-host level.

    Internet layer

    The IPv4 internetwork layer consists of all the protocols and procedures that allow the flow of data between hosts to traverse multiple networks. Therefore, packets that carry data must be routable. The IP (Internet Protocol) protocol is responsible for the routability of packets.

    The internetwork layer must support routing and route management functions. These functions are provided by external protocols called routing protocols. These include IGP (Interior Gateway Protocols) and EGP (Exterior Gateway Protocols).

    Network access level

    The network access layer consists of all the functions required for physical connection and data transmission over the network. In the OSI (Open Systems Interconnection) reference model, this set of functions is divided into two layers: physical and data link. The TCP/IP reference model was created after the protocols present in its name, and in it these two layers were fused together, since the various IP protocols stop at network level. The IP protocol assumes that all low-level functions are provided by either a local network or a serial connection.

    Advantages of TCP/IP

    The TCP/IP protocol enables cross-platform networking (that is, communication across heterogeneous networks). For example, a network under Windows control NT/2000 can host Unix and Macintosh workstations, and even other lower-order networks. TCP/IP has the following characteristics:

    o Good facilities recovery after failures.

    o Ability to add new networks without interrupting current work.

    o Error tolerance.

    o Independence from the implementation platform.

    o Low overhead for transferring service data.

    Levels and protocols TCP/ IP

    The TCP and IP protocols work together to manage data flows (both incoming and outgoing) on ​​a network. But if IP simply forwards packets without paying attention to the outcome, TCP must make sure that the packets arrive in the right place. Specifically, TCP is responsible for performing the following tasks:

    o Opening and closing a session.

    o Package management.

    o Data flow control.

    o Error detection and handling.

    TCP/IP model

    The TCP/IP protocol is usually viewed in the context of a reference model that defines the structural division of its functions. However, the TCP/IP model was developed much later than the protocol complex itself, so it could not in any way be taken as a model when designing protocols.

    TCP/IP protocol family

    The IP protocol family consists of several protocols, often collectively referred to as “TCP/IP”:

    o IP – internetwork layer protocol;

    o TCP is an inter-host protocol that ensures reliable delivery;


    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 optimal size 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 network package data on to the right 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 32 bit binary number. A convenient form of recording an IP address (IPv4) is a record in the form of four groups decimal numbers(from 0 to 255), separated by dots. 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 has 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, IP address this is the 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, mail SMTP the server listens on port 25, the POP3 server reads mail from mailboxes on port 110.

    Thus, in the address packet in the TCP/IP protocol, one more 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).

    UNIX, which contributed to the growing popularity of the protocol, as manufacturers included TCP/IP in the set software every UNIX computer. TCP/IP finds its mapping in the OSI reference model, as shown in Figure 3.1.

    You can see that TCP/IP is located at layers three and four of the OSI model. The point of this is to leave the LAN technology to the developers. The purpose of TCP/IP is message transmission in local networks of any type and establishing communication using any network application.

    The TCP/IP protocol works by being coupled to the OSI model at its two lowest layers—the data layer and the physical layer. This allows TCP/IP to find common language with virtually any network technology and, as a result, with any computer platform. TCP/IP includes four abstract layers, listed below.


    Rice. 3.1.

    • Network interface. Allows TCP/IP to actively interact with all modern network technologies based on the OSI model.
    • Internetwork. Defines how IP controls forwarding messages through routers of a network space such as the Internet.
    • Transport. Defines a mechanism for exchanging information between computers.
    • Applied. Specifies network applications to perform tasks such as forwarding, e-mail and others.

    Due to its widespread use, TCP/IP has become the de facto Internet standard. The computer on which it is implemented network technology, based on the OSI model (Ethernet or Token Ring), has the ability to communicate with other devices. In "Networking Fundamentals" we looked at layers 1 and 2 when discussing LAN technologies. Now we'll move on to the OSI stack and look at how a computer communicates over the Internet or private network. This section discusses the TCP/IP protocol and its configurations.

    What is TCP/IP

    The fact that computers can communicate with each other is itself a miracle. After all, these are computers from different manufacturers, working with various operating systems and protocols. Without some kind of common basis, such devices would not be able to exchange information. When sent over a network, data must be in a format that is understandable to both the sending device and the receiving device.

    TCP/IP satisfies this condition through its internetworking layer. This layer directly matches the network layer of the OSI reference model and is based on a fixed message format called an IP datagram. A datagram is something like a basket in which all the information of a message is placed. For example, when you load a web page into a browser, what you see on the screen is delivered piecemeal by datagram.

    It's easy to confuse datagrams with packets. A datagram is an information unit, while a packet is a physical message object (created at the third and higher layers) that is actually sent over the network. Although some consider these terms interchangeable, their distinction actually matters in a specific context - not here, of course. It is important to understand that the message is broken into fragments, transmitted over the network and reassembled at the receiving device.


    The positive thing about this approach is that if a single packet is corrupted during transmission, then only that packet will need to be retransmitted, not the entire message. Another positive is that no host has to wait indefinitely for a long time until the other host has finished transmitting to send its own message.

    TCP and UDP

    When sending an IP message over a network, one of the transport protocols is used: TCP or UDP. TCP (Transmission Control Protocol) makes up the first half of the acronym TCP/IP. The User Datagram Protocol (UDP) is used instead of TCP to transport less important messages. Both protocols are used for the correct exchange of messages in TCP/IP networks. There is one significant difference between these protocols.

    TCP is called a reliable protocol because it communicates with the recipient to verify that the message was received.

    UDP is called an unreliable protocol because it does not even attempt to contact the recipient to verify delivery.


    It is important to remember that only one protocol can be used to deliver a message. For example, when a web page is loaded, TCP controls packet delivery without any UDP intervention. On the other hand, Trivial File Transfer Protocol (TFTP) downloads or sends messages under the control of the UDP protocol.

    The transport method used depends on the application - it could be email, HTTP, the application responsible for networking work, and so on. Network developers use UDP wherever possible because it reduces overhead traffic. The TCP protocol makes more effort to guarantee delivery and transmits many more packets than UDP. Figure 3.2 shows the list network applications, and shows which applications use TCP and which use UDP. For example, FTP and TFTP do essentially the same thing. However, TFTP is mainly used for downloading and copying programs. network devices. TFTP can use UDP because if the message fails to be delivered, nothing bad happens because the message was not intended for the end user, but for the network administrator, whose priority level is much lower. Another example is a voice video session, in which ports for both TCP and UDP sessions can be used. Thus, a TCP session is initiated to exchange data during installation telephone communication, while himself telephone conversation transmitted via UDP. This is due to the speed of voice and video streaming. If a packet is lost, there is no point in resending it, since it will no longer match the data flow.


    Rice. 3.2.
    IP Datagram Format

    IP packets can be broken down into datagrams. The datagram format creates fields for the payload and for message transmission control data. Figure 3.3 shows the datagram diagram.

    Note. Don't be fooled by the size of the data field in a datagram. The datagram is not overloaded with additional data. The data field is actually the largest field in the datagram.


    Rice. 3.3.

    It is important to remember that IP packets can have different lengths. In "Networking Fundamentals" it was said that information packets in Ethernet networks have a size from 64 to 1400 bytes. In the Token Ring network their length is 4000 bytes, in the ATM network - 53 bytes.

    Note. The use of bytes in a datagram can be confusing, since data transfer is often associated with concepts such as megabits and gigabits per second. However, because computers prefer to work with data bytes, datagrams also use bytes.

    If you look again at the datagram format in Figure 3.3, you'll notice that the leftmost margins are a constant value. This happens because the CPU processing the packets needs to know where each field begins. Without standardization of these fields, the final bits will be a jumble of ones and zeros. On the right side of the datagram are packets of variable length. The purpose of the various fields in a datagram is as follows.

    • VER. The version of the IP protocol used by the station where the original message appeared. Current version IP is version 4. This field ensures concurrent existence different versions in the internetwork space.
    • HLEN. The field informs the receiving device of the length of the header so that the CPU knows where the data field begins.
    • Service type. Code that tells the router the type of packet control in terms of service level (reliability, priority, deferment, etc.).
    • Length. The total number of bytes in the packet, including header fields and data fields.
    • ID, frags and frags offset. These fields tell the router how to fragment and reassemble the packet and how to compensate for differences in frame size that may occur as the packet traverses segments. local network with various network technologies (Ethernet, FDDI, etc.).
    • TTL. An abbreviation for Time to Live is a number that decreases by one each time a packet is sent. If the lifetime becomes zero, the packet ceases to exist. TTL prevents loops and lost packets from wandering endlessly across the Internet.
    • Protocol. The transport protocol to use to transmit the packet. The most common protocol specified in this field is TCP, but other protocols may be used.
    • Header checksum. A checksum is a number that is used to verify the integrity of a message. If the checksums of all message packets do not match the correct value, then the message has been corrupted.
    • Source IP address. The 32-bit address of the host that sent the message (usually personal computer or server).
    • Destination IP address. The 32-bit address of the host to which the message was sent (usually a personal computer or server).
    • IP options. Used for network testing or other special purposes.
    • Padding. Fills all unused (empty) bit positions so that the processor can correctly determine the position of the first bit in the data field.
    • Data. The payload of the sent message. For example, the package data field may contain the text of an email.

    As mentioned earlier, the packet consists of two main components: data about message processing, located in the header, and the information itself. The information part is located in the payload sector. You can imagine this sector as the cargo compartment of a spaceship. The header is all of the shuttle's onboard computers in the control cabin. It manages all the information needed by all the different routers and computers along the message path, and is used to maintain a certain order in assembling the message from individual packets.

    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 devices data transmissions exchange information. There are protocols for error control formats and other types of protocols. Most commonly used in global internetworking TCP-IP protocol.

    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 UDP protocols, SMTP, ICMP, FTP, telnet, and more. These and other TCP-IP protocols provide the most full-time job Internet networks.

    Below we provide a detailed description of each protocol included in general concept 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 required.

    . Transmission Control Protocol(TCP) is used for more high 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 in Internet networks. 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 by email, which 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 calculation occurs checksum, which is then written to 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 operation of the global Internet is based on a set (stack) of TCP/IP protocols. But these terms seem complex only at first glance. In fact TCP/IP protocol stack is a simple set of rules for exchanging information, and these rules are actually well known to you, although you probably are not aware of it. Yes, that’s exactly right; essentially, there is nothing new in the principles underlying the TCP/IP protocols: everything new is well-forgotten old.

    A person can learn in two ways:

    1. Through stupid formal memorization of formulaic methods for solving standard problems (which is what is now mostly taught in school). Such training is ineffective. Surely you have seen the panic and complete helplessness of an accountant when changing the version office software- at the slightest change in the sequence of mouse clicks required to perform habitual actions. Or have you ever seen a person fall into a stupor when changing the desktop interface?
    2. Through understanding the essence of problems, phenomena, patterns. Through understanding principles building this or that system. In this case, having encyclopedic knowledge does not play a big role - the missing information is easy to find. The main thing is to know what to look for. And this requires not formal knowledge of the subject, but an understanding of the essence.

    In this article, I propose to take the second path, since understanding the principles underlying the Internet will give you the opportunity to feel confident and free on the Internet - quickly solve problems that arise, correctly formulate problems and confidently communicate with technical support.

    So let's begin.

    The principles of operation of the TCP/IP Internet protocols are inherently very simple and strongly resemble the work of our Soviet postal service.

    Remember how our regular mail works. First, you write a letter on a piece of paper, then put it in an envelope, seal it, back side envelope, write the addresses of the sender and recipient, and then take it to the nearest post office. Next, the letter passes through a chain of post offices to the nearest post office of the recipient, from where it is delivered by the postman to the specified address recipient and dropped into his mailbox (with his apartment number) or delivered personally. That's it, the letter has reached the recipient. When the recipient of the letter wants to answer you, he will swap the addresses of the recipient and the sender in his response letter, and the letter will be sent to you along the same chain, but in the opposite direction.

    The envelope of the letter will read something like this:

    Sender's address: From whom: Ivanov Ivan Ivanovich Where: Ivanteevka, st. Bolshaya, 8, apt. 25 Recipient address: To whom: Petrov Petr Petrovich Where: Moscow, Usachevsky lane, 105, apt. 110

    Now we are ready to consider the interaction of computers and applications on the Internet (and on the local network too). Please note that the analogy with regular mail will be almost complete.

    Each computer (aka: node, host) on the Internet also has a unique address, which is called an IP address (Internet Protocol Address), for example: 195.34.32.116. An IP address consists of four decimal numbers (0 to 255) separated by a dot. But knowing only the IP address of the computer is not enough, because... Ultimately, it is not the computers themselves that exchange information, but the applications running on them. And several applications can run simultaneously on a computer (for example, a mail server, a web server, etc.). To deliver a regular paper letter, it is not enough to know only the address of the house - you also need to know the apartment number. Also every software application has a similar number called the port number. Most server applications have standard rooms, for example: the mail service is bound to port number 25 (they also say: “listens” to the port, receives messages on it), the web service is bound to port 80, FTP to port 21, and so on.

    Thus, we have the following almost complete analogy with our usual postal address:

    "house address" = "computer IP" "apartment number" = "port number"

    In computer networks operating using TCP/IP protocols, an analogue of a paper letter in an envelope is plastic bag, which contains the actual transmitted data and address information - the sender’s address and the recipient’s address, for example:

    Source address: IP: 82.146.49.55 Port: 2049 Recipient address (Destination address): IP: 195.34.32.116 Port: 53 Package details: ...

    Of course, the packages also contain service information, but this is not important for understanding the essence.

    Please note the combination: "IP address and port number" - called "socket".

    In our example, we send a packet from socket 82.146.49.55:2049 to socket 195.34.32.116:53, i.e. the package will go to a computer with an IP address of 195.34.32.116, to port 53. And port 53 corresponds to a name recognition server (DNS server) that will receive this packet. Knowing the sender's address, this server will be able, after processing our request, to form a response packet that will go in the opposite direction to the sender socket 82.146.49.55:2049, which for the DNS server will be the recipient socket.

    As a rule, interaction is carried out according to the “client-server” scheme: the “client” requests some information (for example, a website page), the server accepts the request, processes it and sends the result. The port numbers of server applications are well known, for example: the SMTP mail server listens on port 25, the POP3 server that allows reading mail from your mailboxes listens on port 110, the web server listens on port 80, etc.

    Most programs on home computer are clients - for example mail client Outlook, web browsers IE, FireFox, etc.

    The port numbers on the client are not fixed like those on the server, but are assigned dynamically by the operating system. Fixed server ports usually have numbers up to 1024 (but there are exceptions), and client ports start after 1024.

    Repetition is the mother of teaching: IP is the address of a computer (node, host) on the network, and port is the number specific application running on this computer.

    However, it is difficult for a person to remember digital IP addresses - it is much more convenient to work with alphabetic names. After all, it is much easier to remember a word than a set of numbers. This is done - any digital IP address can be associated with an alphanumeric name. As a result, for example, instead of 82.146.49.55, you can use the name And the domain name service (DNS) (Domain Name System) handles the conversion of the domain name to a digital IP address.

    Let's take a closer look at how this works. Your provider is clearly (on paper, for manual settings connection) or implicitly (through automatic connection configuration) provides you with the IP address of the name server (DNS). On a computer with this IP address there is an application (name server) running that knows all the domain names on the Internet and their corresponding digital IP addresses. The DNS server “listens” to port 53, accepts requests to it and issues responses, for example:

    Request from our computer: "What IP address corresponds to the name www.site?" Server response: "82.146.49.55."

    Now let's look at what happens when you type in your browser domain name(URL) of this site () and by clicking , in response from the web server you receive a page of this site.

    For example:

    IP address of our computer: 91.76.65.216 Browser: Internet Explorer(IE), DNS server (stream): 195.34.32.116 (yours may be different), The page we want to open: www.site.

    Recruiting at address bar browser domain name and click . Next operating system does approximately the following:

    A request is sent (more precisely, a packet with a request) DNS server to socket 195.34.32.116:53. As discussed above, port 53 corresponds to the DNS server, an application that resolves names. And the DNS server, having processed our request, returns the IP address that matches the entered name.

    The dialogue goes something like this:

    What IP address corresponds to the name www.site? - 82.146.49.55 .

    Next, our computer establishes a connection to the port 80 computer 82.146.49.55 and sends a request (request packet) to receive the page. Port 80 corresponds to the web server. Port 80 is usually not written in the address bar of the browser, because is used by default, but it can also be specified explicitly after the colon - .

    Having received a request from us, the web server processes it and sends us a page in several packets. HTML language- a text markup language that the browser understands.

    Our browser, having received the page, displays it. As a result, we see on the screen home page this site.

    Why do we need to understand these principles?

    For example, did you notice strange behavior your computer - incomprehensible network activity, slowdowns, etc. What to do? Open the console (click the “Start” button - “Run” - type cmd - “Ok”). In the console we type the command netstat -an and click . This utility will display a list established connections between the sockets of our computer and the sockets of remote hosts. If we see some foreign IP addresses in the “External Address” column, and the 25th port after the colon, what could this mean? (Remember that port 25 corresponds to the mail server?) This means that your computer has established a connection to some mail server (servers) and is sending some letters through it. And if your email client (Outlook for example) is not running at this time, and if there are still many such connections on port 25, then probably a virus has appeared on your computer that sends spam on your behalf or forwards your numbers credit cards along with passwords to attackers.

    Also, an understanding of how the Internet works is necessary for correct settings firewall (in other words, firewall :)). This program (which often comes with an antivirus) is designed to filter packets - "friend" and "enemy". Let your own people through, don’t let strangers in. For example, if your firewall tells you that someone wants to establish a connection to some port on your computer. Allow or deny?

    And most importantly, this knowledge is extremely useful when communicating with technical support.

    Finally, here is a list of ports that you are likely to encounter:

    135-139 - these ports are used by Windows to access shared computer resources - folders, printers. Do not open these ports to the outside, i.e. to the regional local network and the Internet. They should be closed with a firewall. Also, if on the local network you do not see anything in the network environment or you are not visible, then this is probably due to the fact that the firewall has blocked these ports. Thus, these ports must be open for the local network, but closed for the Internet. 21 - port FTP server. 25 - postal port SMTP server. Your email client sends letters through it. The IP address of the SMTP server and its port (25th) should be specified in the settings of your mail client. 110 - port POP3 server. Through it, your mail client collects letters from your mailbox. The IP address of the POP3 server and its port (110th) should also be specified in the settings of your mail client. 80 - port WEB-servers. 3128, 8080 - proxy servers (configured in browser settings).

    Several special IP addresses:

    127.0.0.1 is the localhost address local system, i.e. local address your computer. 0.0.0.0 - this is how all IP addresses are designated. 192.168.xxx.xxx - addresses that can be used arbitrarily on local networks; they are not used on the global Internet. They are unique only within the local network. You can use addresses from this range at your discretion, for example, to build a home or office network.

    What is the subnet mask and default gateway (router, router)?

    (These parameters are set in the network connection settings).

    It's simple. Computers are connected into local networks. On a local network, computers directly “see” only each other. Local networks are connected to each other through gateways (routers, routers). The subnet mask is designed to determine whether the recipient computer belongs to the same local network or not. If the receiving computer belongs to the same network as the sending computer, then the packet is sent to it directly, otherwise the packet is sent to the default gateway, which then, using routes known to it, transmits the packet to another network, i.e. to another post office (by analogy with the Soviet post office).

    Finally, let’s look at what these unclear terms mean:

    TCP/IP is the name of a set of network protocols. In fact, the transmitted packet goes through several layers. (Like in the post office: first you write a letter, then you put it in an addressed envelope, then the post office puts a stamp on it, etc.).

    IP The protocol is a so-called network layer protocol. The task of this level is to deliver IP packets from the sender's computer to the recipient's computer. In addition to the data itself, packets at this level have a source IP address and a recipient IP address. Port numbers are not used at the network level. Which port, i.e. the application is addressed to this packet, whether this packet was delivered or was lost is unknown at this level - this is not its task, this is the task of the transport layer.

    TCP and UDP These are protocols of the so-called transport layer. The transport layer sits above the network layer. At this level, a source port and a destination port are added to the packet.

    TCP is a connection-oriented protocol with guaranteed packet delivery. First, special packets are exchanged to establish a connection, something like a handshake occurs (-Hello. -Hello. -Shall we chat? -Come on.). Further, packets are sent back and forth over this connection (a conversation is ongoing), and a check is made to see whether the packet has reached the recipient. If the packet is not received, it is sent again (“repeat, I didn’t hear”).

    UDP is a connectionless protocol with non-guaranteed packet delivery. (Like: shouted something, but whether they heard you or not - it doesn’t matter).

    Above the transport level is application layer. At this level, protocols such as http, ftp etc. For example, HTTP and FTP use the reliable TCP protocol, and the DNS server works through the unreliable UDP protocol.

    How to view current connections?

    Current connections can be viewed using the command

    Netstat -an

    (the n parameter specifies to display IP addresses instead of domain names).

    This command runs like this:

    “Start” - “Run” - type cmd - “Ok”. In the console that appears (black window), type the command netstat -an and click . The result will be a list of established connections between the sockets of our computer and remote nodes.

    For example we get:

    Active connections

    Name Local address External address State
    TCP 0.0.0.0:135 0.0.0.0:0 LISTENING
    TCP 91.76.65.216:139 0.0.0.0:0 LISTENING
    TCP 91.76.65.216:1719 212.58.226.20:80 ESTABLISHED
    TCP 91.76.65.216:1720 212.58.226.20:80 ESTABLISHED
    TCP 91.76.65.216:1723 212.58.227.138:80 CLOSE_WAIT
    TCP 91.76.65.216:1724 212.58.226.8:80 ESTABLISHED
    ...

    In this example, 0.0.0.0:135 means that our computer listens (LISTENING) to port 135 at all its IP addresses and is ready to accept connections from anyone on it (0.0.0.0:0) via the TCP protocol.

    91.76.65.216:139 - our computer listens to port 139 on its IP address 91.76.65.216.

    The third line means that the connection is now established (ESTABLISHED) between our machine (91.76.65.216:1719) and the remote one (212.58.226.20:80). Port 80 means that our machine made a request to the web server (I actually have pages open in the browser).

    In future articles we will look at how to apply this knowledge, e.g.