NETWORK PROTOCOLS
NETWORK PROTOCOLS
A protocol is is a set of rules and conventions that define how data is transmitted and received
across a network.
1. Connection Establishment
Protocols initiate a connection between devices to set up a communication path before data
transmission starts. One commonly used protocol for connection establishment is the
Transmission Control Protocol (TCP), which uses a process called the "three-way handshake":
SYN (Synchronize): The sender sends a SYN packet to the receiver, requesting a
connection.
SYN-ACK (Synchronize-Acknowledge): The receiver responds with a SYN-ACK
packet, acknowledging the request and agreeing to establish a connection.
ACK (Acknowledge): The sender sends an ACK packet to confirm the connection is
ready, establishing a two-way communication channel.
This handshake ensures both devices are ready to transmit and receive data. For protocols that
don’t require a persistent connection, such as User Datagram Protocol (UDP), connection
establishment is skipped, allowing faster but less reliable communication.
2. Data Packaging
Once the connection is established, the data is prepared for transmission. Here’s how data
packaging works:
Segmentation: Large data is split into smaller pieces called "packets" (for TCP/IP) or
"datagrams" (for UDP). Each packet is small enough to travel across the network and is
tagged with a sequence number so the receiver can reassemble it correctly.
Encapsulation: Each packet receives a "header" and sometimes a "footer" with essential
information, such as:
o Source and destination IP addresses (to identify where the packet came from
and where it’s going).
o Protocol information (to specify which protocol the packet belongs to, such as
TCP, UDP, or HTTP).
o Error-checking data (to verify the packet's integrity during transmission).
Network protocols implement encryption and authentication to protect data during transmission.
A few widely used protocols for data security include:
SSL/TLS (Secure Sockets Layer/Transport Layer Security): Used by HTTPS (secure
web browsing), SSL/TLS encrypts the data before transmission, making it unreadable to
unauthorized parties.
IPsec (Internet Protocol Security): Used in VPNs, IPsec encrypts data at the IP layer,
creating a secure tunnel for the packets.
Authentication: Protocols like SSL/TLS use certificates to verify the identities of the
sender and receiver, ensuring only authorized parties can access the data.
4. Data Transmission
With the connection established, data packaged, and secured, transmission begins:
Routing: The Internet Protocol (IP) routes packets across multiple networks and devices,
choosing the most efficient path from sender to receiver.
Flow Control and Congestion Control: Protocols like TCP manage data flow to prevent
congestion, adjusting the data rate if the network is overloaded to prevent packet loss.
Decapsulation: The receiver removes headers and footers, extracting the actual data.
Error Checking: TCP uses checksums to detect any errors during transmission. If an
error is found (e.g., a corrupted packet), the receiver requests retransmission of the
affected packet.
Reassembly: For segmented data, packets are reassembled based on their sequence
numbers. TCP ensures that all packets are received in the correct order, even if they
arrive out of sequence.
Acknowledgments: The receiver sends an acknowledgment (ACK) for each successfully
received packet. If the sender doesn’t receive an ACK within a specified time, it resends
the packet.
If the data is encrypted, the receiver decrypts it using a secure key shared during the connection
setup (in SSL/TLS, for example). This decryption process converts the data back into its original,
readable form, ensuring that only the intended recipient can access it.
7. Connection Termination
When data transmission is complete, the connection is terminated to free up network resources.
For TCP connections, a four-step process called the "four-way handshake" is used:
FIN (Finish): The sender sends a FIN packet, indicating it wants to close the connection.
ACK (Acknowledge): The receiver sends an ACK packet, acknowledging the request.
FIN (Finish): The receiver sends its own FIN packet to confirm it’s ready to end the
connection.
ACK (Acknowledge): The sender responds with a final ACK, and the connection is fully
terminated.
After termination, the network connection is closed, and both devices can reuse resources for
future connections.
Summary
Network protocols work in coordinated steps to enable reliable and secure data transmission:
These steps enable smooth and secure communication, ensuring data integrity, security, and
efficiency across various networks.
4o