Five-layer network protocol model

Physical Layer

Between two network devices transparently transmit bit stream, the transmission of electrical signals in binary 010101.

data link layer

The electrical physical layer packets, each set of data called a message / data frames, each data frame is divided into: a header and a data head data of two parts
i.e. every packet header and the data are from two parts.

Header: fixed 18 bytes, 6: sender address / 6: receiver address / 6: Data type
mac address: sending end and a receiving end refers to the address is the address of the card, i.e., the Mac address

Broadcasting: the underlying computer, as long as a local area network, is broadcast by the way, but only communications, broadcast storm will occur within a local area network.

Network layer

Introducing a new address is used to distinguish between different broadcast domain / subnet, this address is the network address

IP: ipv4: 32-bit binary represented: dotted decimal notation: from 0.0.0.0 to 255.255.255.255, the range is limited, not shown all the network devices, so there ipv6

Subnet Mask: subnet mask and ip is determined by two ip is in the same network segment, do a bitwise ip address and subnet mask by

  • 172.16.10.1:10101100.00010000.00001010.000000001

    • 255.255.255.0:11111111.11111111.11111111.00000000
    • AND operation results obtained network address: 10101100.00010000.00001010.000000000-> 172.16.10.0
  • 172.16.10.2:10101100.00010000.00001010.000000010

    • 255.255.255.0:11111111.11111111.11111111.00000000

    • AND operation results obtained network address: 10101100.00010000.00001010.000000000-> 172.16.10.0

      The result is 172.16.10.0, so they are in the same subnet.

IP and MAC have conversion relationship: Host 172.16.10.10/24 access 172.16.10.11/24

ARP protocol: send a broadcast packet, the destination hosts mac address

mac address learning: mac address and ip address mapping table

A first received data will increase ip / mac mapping table

Any kind of protocol has headers and content

Transport Layer

Transport layer functions: establishing a communication port to port

Transport layer needs to have two different transport protocols, namely TCP and UDP for connectionless connection.

TCP protocol:

  • TCP is a connection-oriented transport layer protocol.
  • Each TCP connection can have only two endpoints (endpoint), TCP connection each can only point to point (one to one).
  • TCP provides reliable service delivery.
  • TCP provides full-duplex communication.
  • Byte stream oriented.

TCP three-way handshake and four wave

img

UDP protocol:

Features:

  • Without establishing a connection before the UDP is a connectionless, i.e., the transmission data.

  • UDP uses a best effort delivery, that does not guarantee reliable delivery, while not using congestion control.

  • UDP is a message-oriented. UDP does not congestion control, it is required for multimedia communication.

  • UDP support one to one, one to many, and many-to-many interactive communication.

  • UDP header overhead small, only 8 bytes.

port:

We find over IP and Mac with a specific host, how to identify applications on this host, the answer is a port, a port that is associated with the application of the card number.

Application layer

Application layer functions: a predetermined data format of the application.
Example: TCP protocol data can be transferred to various programs, such as Email, WWW, FTP and the like. So, there must be agreement provides different e-mail, Web pages, FTP data format, these application protocols constitute the "application level."

Process Analysis Internet:
1. In the browser input www.baidu.com
2. dns will be taken by the server to the DNS ip address
3. Send request to the ip address + port number, the server will have access to Baidu

socket: In an abstraction layer between the application layer and transport layer, it is the TCP / IP layer complex operations few simple abstract interface layer serves the calling process has been implemented in a communication network

Guess you like

Origin www.cnblogs.com/qwksjy/p/11466450.html