Packet structure

Ethernet head The length of 14 Byte
IPv4 first The length of 20 + Byte
The TCP header The length of 20 + Byte
User-defined application layer protocols The length of the N Byte
Ethernet tail The length of the 4 Byte


OSI seven layer model

The Open System Interconnection Model


Layers in the Internet protocol stack Code instructions
The physical layer physical layer Transmit data frames over a local area network.

Examples are modems, radio, fiber optics
Data link layer data link layer Data link headers (DLH) are methods that contain physical addresses and error detection and correction.

Such as Ethernet, token ring, HDLC, Frame Relay, ISDN, ATM, IEEE 802.11, FDDI, PPP
The network layer network layer The network header (NH) determines the path selection and forwarding of data.

For example, IP, ICMP, IPX, BGP, OSPF, RIP, IGRP, EIGRP, ARP, RARP, and X.25
The transport layer transport layer The transport header (TH) contains the protocol used to send information.

For example, TCP, UDP, RTP, SCTP, SPX, ATP, and IL
The session layer session layer To set up and maintain communication connections between two computers in a computer network in data transfer.

For example, ASAP, ISO 8327 / CCITT X.225, RPC, NetBIOS, Winsock, BSD Sockets, SOCKS, and password authentication protocol
The presentation layer presentation layer To convert data into a format compatible with the receiver’s system format and suitable for transmission.

For example, JPEG, ASCII, UTF-8
The application layer application layer Provides interfaces for application software.

For example, HTTP, SMTP, SNMP, FTP, Telnet, SIP, SSH, NFS, RTSP, XMPP, Whois, ENRP, and TLS