Basics of Computer Networks - First Understanding Protocols

  • Table of contents

1. First understanding of the protocol:

1.1, data communication protocol

1.2, protocol layering

1.3, MAC-Layer 2 protocol

1.4, Ethernet frame format

1.5, network IP layer 3 protocol

1.6, IP header format

1.7, the role of IP address

1.8, AIP protocol

1.9, RAPR protocol

Second, the working principle of proxy APR

Three, ICPMP protocol

3.1, the application of ICMP protocol

Four, HTTP

4.1, http-application layer protocol

4.2, Common Web server components

Five, DNS (Domain Name System)

5.1, Function of DNS

5.2, DNS namespace

5.3, Scope

5.4, ​​DNS working principle

Six, SMTP/POP3

6.1, SMTP

6.2, POP3

Seven, telnet/FTP protocol

7.1, telnet protocol

7.2, FTP protocol

7.3, How FTP works

Eight, TCP, UDP protocol establishment method

8.1, the protocol of the transport layer

8.2, TCP timer


1. First understanding of the protocol:

For data to travel from source to destination, all devices on the network need to "speak" the same "language".

A set of rules describing how to regulate the use of "language" in network communication is a protocol.

1.1, data communication protocol

A set of rules or conventions that determine the format of data and the transmission of data.

1.2, protocol layering

Data is transmitted from the source point to the destination point, and all devices on the network need to "speak" the same "language". A set of rules describing how to regulate the use of "language" in network communication is a protocol.

1.3, MAC-Layer 2 protocol

An Ethernet address is used to identify an individual device or a group of devices on an Ethernet

1.4, Ethernet frame format

802.3 Ethernet frame format

1.5, network IP layer 3 protocol

  • Defines the logical address based on the IP protocol
  • Choose the best route for your data to the French network

1.6, IP header format

1.7, the role of IP address

  • Used to represent the network address of a node

1.8, AIP protocol

IP address resolution to MAC address

  1. The host 10.1.1.1 likes to send data to the host 10.1.1.2, checks the cache, and finds that there is no MAC address of 10.1.1.2

  1. Host 10.1.1.1 sends an ARP broadcast

  1. All hosts receive the ARP broadcast of 10.1.1.1, but only 10.1.1.2 gives him a single wave reply and caches the MAC address of 10.1.1.1

4. Host A saves the MAC address of host B in the cache and sends data

1.9, RAPR protocol

MAC address resolved to IP address

  • Host A needs an IP address and sends an ARP broadcast
  • The host 10.1.1.254 is the server that assigns the IP address, it will give a reply to A

Second, the working principle of proxy APR

2.1, Proxy ARP working principle-1

The IP address is resolved to the interface MAC address of the gateway

• The host 10.1.1.1 needs to send data to the host 172.16.1.1 which is not in the same network segment, but does not know its MAC address, so it sends an ARP broadcast

  • The gateway 10.1.1.254 sends a unicast reply to 10.1.1.1 and tells 10.1.1.1 the MAC address of its own interface

Three, ICPMP protocol

  • ICMP messages are carried in IP datagrams and are used to send error and control information
  • ICMP defines many message types, such as
  • Destination Unreachable TTL Timeout Information Request Information Reply Address Request Address Reply

3.1, the application of ICMP protocol

When a computer initiates a ping connection to a remote host, the return information that may be received includes:

Connection established successfully • Reply from 192.168.1.1:bytes=32 time<1ms TTL=128

Destination host unreachable• Destination host unreachable

• Request timed out.

Unknown host name • Unknown host abc

Four, HTTP

4.1, http-application layer protocol

  • HTTP (HyperText Transfer Protocol, Hypertext Transfer Protocol) is a simple request-response protocol, which usually runs on top of TCP and is an application layer protocol. HTTP is used to enable communication between browsers and web servers. It specifies the communication method between the browser and the Web server, that is, how the browser requests messages from the Web server, and how the server replies to the browser. HTTP is an important basis for information exchange on the Internet.

4.2, Common Web server components

  • Websites can be simply distinguished, and can be divided into static websites and dynamic websites. Dynamic websites can be calculated using scripting languages, while a dynamic website is generally composed of an operating system equipped with a web application and then linked to a database. Generally, we use a web application equipped with calculator, call it a web server

Five, DNS (Domain Name System)

5.1, Function of DNS

  • DNS • Domain Name System Domain Name System • Used to complete the mapping between domain names and IP addresses • The port number is 53 of TCP or UDP

5.2, DNS namespace

5.3, Scope

5.4, ​​DNS working principle

Six, SMTP/POP3

6.1, SMTP

  • Simple Mail Transfer Protocol - Simple Mail Transfer Protocol
  • for sending and receiving mail
  • port number 25

6.2, POP3

  • Post Office Protocol v3 - Post Office Protocol version 3
  • For client to receive mail
  • port number 11

Seven, telnet/FTP protocol

7.1, telnet protocol

Terminal Network • Used for remote management of network devices such as computers or routers in text mode • The port number is TCP 23

  • Start the operation on the host - run - cmd telnet 10.1.1.1
  • telnet IP port

7.2, FTP protocol

  • FTP File Transfer Protocol-The file transfer protocol is used to transfer files, the port numbers are 21 and 20 of TCP

7.3, How FTP works

Eight, TCP, UDP protocol establishment method

TCP/IP Protocol Stack - Review

8.1, the protocol of the transport layer

  • TCP (Transmission Control Protocol) • Transmission Control Protocol • Reliable, connection-oriented protocol • Transmission efficiency
  • UDP (User Datagram Protocol) • User Datagram Protocol • Unreliable, connectionless service • High transmission efficiency

TCP encapsulation format

TCP connection - three-way handshake

Four disconnections of TCP

TCP error control

  • Three methods of TCP error control • Checksum • Acknowledgment • Damaged segment • Lost segment • Duplicated segment • Out-of-sequence segment • Lost acknowledgment
  • time out

8.2, TCP timer

Retransmission timer - to control lost data segments

Persist Timer - To prevent zero window deadlock

Keepalive timer - prevents the connection between two TCPs from being idle

time wait timer - used during connection termination

After sending the last ACK, do not close the connection immediately, but wait for a period of time to ensure that repeated FIN data segments can be received

Application of TCP

Use of UDP

Flow Control and Error Control of UDP

• UDP has no flow control mechanism • UDP only has a checksum to provide error control • An upper layer protocol is required to provide error control: eg TFTP protocol

Guess you like

Origin blog.csdn.net/qq_52497256/article/details/131596235