...
Code Block | ||
---|---|---|
| ||
if (rx_tcp_packet->ack_num > TCP_CURRENT_ACK_NUM) { /* process packet */ } else { /* ignore packet -- it was a duplicate */ } |
Timing
The timing of a network protocol is the use of a clock to internally generate events not initiated by an external stimulus, such as the arrival of a packet. An example of timing in TCP is the use of timers to detect TCP connection timeouts and to retransmit lost data.
...
Together, the semantics and timing of a network protocol define the protocol's behavior. This behavior can be represented by a finite state machine. Typically, the finite state machine of a network protocol is drawn as a state diagram. Consider a simplified state diagram for TCP:
<simple TCP diagram>
For those who are curious, this is the actual, far more complex state diagram for TCP (borrowed from ssfnet.org):
<real TCP diagram>
Don't worry, we won't cover the actual state machine of TCP in ECE 4400/6400 However, if you're interested, ECE 4380/6380 is highly recommended.
...
<layer and peering figure>
Protocol Layers
Layer 1: Physical Layer
- transmission of data symbols over physical medium
- includes bit synchronization between directly connected devices
- physical (electrical or mechanical) interface between devices
data unit = bit
Layer 2: Data Link Layer
- transfer of blocks of data across communication link between directly connected devices
- includes block synchronization, link error control, and link flow control
- data unit = frame
Layer 3: Network Layer
- transfer of data through communications network
- multiple data link protocols may occur in route between source and destination
- determines best path between source and destination (i.e. routing)
- data unit = packet
Layer 4: Transport Layer
- reliable end-to-end data transfer between source and destination end hosts
- end-to-end error detection and recovery
- end-to-end flow control and congestion response
- segmentation and reassembly of user data blocks
- data unit = segment
Layer 5: Session Layer
- establish and terminate data transfer sessions between applications
Layer 6: Presentation Layer
- data format translation
- encryption/decryption
Layer 7: Application Layer
- user/application software
...
In general standardization of anything improves interoperability of products from different vendors by providing a common, "standard" baseline that all products that claim to follow the particular standard must satisfy. The International Organization for Standards (ISO) Open System Interconnection (OSI) Reference Model (commonly referred to as the OSI model) formally defines the aforementioned layers in a network protocol "stack".
<osi-model-figure>
Over time, the OSI model has proven to have many shortcomings:
...
Note how the web browser and TCP on the end hosts traverse the entire network, while IP and Ethernet are utilized twice – once on each side of the router. The TCP/IP protocol suite is often referred to as a "stack", where each layer is pushed or popped as necessary in order to traverse each network.
Data Link Layer
- access to physical medium
- error recovery and flow control between hosts on the same subnet
- various protocols e.g. Ethernet
...
- routing and forwarding of packets
- various protocols e.g. IPv4, IPv6, BGP, RIP
Transport Layer
- segmentation and reassembly
- end-to-end connection management
- end-to-end flow control
- end-to-end error detection and recovery
- various protocols e.g. TCP and UDP
Application Layer
- user application data handling
- various protocols e.g. HTTP, FTP
...