Table of Contents
Assigned Reading
Chapter 10
Network Protocols
A protocol is the set of conventions (i.e. rules) governing the exchange of information between paired entities in two systems.
What Defines a Protocol?
Syntax
The syntax of a network protocol is the structure used in communicating information, such as the formatting of data and control information. Consider TCP as an example:
<tcp header image>
Lexicon
The lexicon of a network protocol is the collection of valid entries within the structure of the syntax. The lexicon is in other words, the vocabulary of the protocol. Continuing our TCP example, the TCP lexicon dictates that of the possible TCP flags, xor(RST, SYN, FIN) should be in a TCP header.
Semantics
The semantics of a network protocol is the meaning of the data or control information exchanged, including the actions that result from the data or control information. Building further on our TCP example, if a duplicate acknowledgement (i.e. ACK) is received in a TCP connection, the software implementing TCP on the end host will ignore the duplicate.
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.
Finite State Machine
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:
<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.
What Features Should/Could a Protocol Provide?
Synchronization
The goal of synchronization is the maintain consistent state information between the communicating entities in two systems. In other words, synchronization allows both entities to maintain the same finite state machine. With regard to TCP, it keeps both end hosts synchronized using sequence numbers and acknowledgements.
Connection Control
Connection control maintains logical association between two communicating entities, such as:
- connection establishment
- data transfer
- flow control
- guaranteed delivery
- in-order delivery
connection termination
For example, IP only provides data transfer as a connection control mechanism. It delegates connection establishment and termination, flow control, and guaranteed and in-order delivery to other network protocols, such as TCP. TCP provides all connection control features listed above.
Transmission Services
The goal of transmission services are to provide those "nice to have" features of a network protocol that are not strictly required for basic data transfer. Transmission services can include:
- priority
- quality of service
- security
As an example, IP headers contain what is called the differentiated services code point (DSCP), formerly known as "type of service". DSCP allows communicating entities to classify packets for priority or special handling by network forwarding devices. Possible options within the DSCP field include but are not limited to "best effort", "priority", and "critical", used to signal the importance of the data in the packet. Real time streaming video and voice can use the "critical" bit to encourage forwarding devices to prioritize it.
As for security, the transport layer security protocol or TLS (often referred to by its predecessor secure sockets layer or SSL) is a protocol often used to encrypt sensitive data, as well as provide authentication prior to data transfer. It is common to find TLS used within TCP, to provide a reliable and secure end-to-end connection.
Addressing and Address Resolution