Wireless Mobile Computer
Wireless Mobile Computer
ROUTING PROTOCOLS
BGP is a core protocol of the internet that manages how packets are
routed between autonomous systems (AS), which are large networks or
groupings of networks under a single administrative domain. It is an
Exterior Gateway Protocol (EGP), designed for routing between
different ASes.
2. OSPF
Overview:
OSPF is a link-state routing protocol that uses the Dijkstra
algorithm to calculate the shortest path to a destination.
It is more efficient and scalable than RIP, making it suitable for
large networks.
Key Features:
Hierarchical Structure:
o Divides networks into areas to reduce routing table size and
processing overhead.
o Area 0 (Backbone Area) connects all other areas.
Metric: Uses cost, derived from the link's bandwidth, to
determine the best path.
Convergence: Fast due to immediate updates on topology
changes.
Routing Updates: Triggered by topology changes, reducing
unnecessary traffic.
Authentication: Supports MD5 and other methods for secure
routing exchanges.
Protocol Version:
o OSPF v2: For IPv4 networks.
o OSPF v3: For IPv6 networks.
Advantages:
Supports large and complex networks.
Reduces network traffic with triggered updates.
Detects and recovers from failures quickly.
Example: In an enterprise network, OSPF ensures efficient routing by
dividing the network into areas (e.g., Area 0 for core routers and other
areas for branch offices).
TCP
TCP is a connection-oriented protocol used in transport layer
communication. It provides reliable data transfer, ensuring that packets
are delivered in the correct order without duplication.
1. Segment format
A TCP segment is the fundamental unit of data transmission. The TCP
header, attached to the data, contains crucial information for
communication.
TCP Header Format:
Field Size Description
Source Port 16 bits Port number of the sender.
Destination Port 16 bits Port number of the receiver.
Number identifying the order of bytes
Sequence Number 32 bits
in the data stream.
Acknowledgment Indicates the next expected byte from
32 bits
Number the sender.
Data Offset 4 bits Specifies the size of the TCP header.
Field Size Description
Reserved 3 bits Reserved for future use.
Includes SYN, ACK, FIN, RST, PSH,
Flags (Control Bits) 9 bits and URG for connection control and
data flow.
Indicates the size of the receive
Window Size 16 bits
window for flow control.
Checksum 16 bits Ensures data integrity.
Used with the URG flag to indicate
Urgent Pointer 16 bits
priority data.
Additional features (e.g., selective
Options Variable
acknowledgment).
Data Variable The payload being transmitted.
2. Sockets
A socket is an endpoint for communication between two devices in a
TCP/IP network.
Components of a Socket:
1. IP Address: Identifies the host device.
2. Port Number: Identifies the application or service on the
device.
Socket Address:
Combination of an IP address and a port number (e.g.,
192.168.1.1:80).
Types of Sockets:
o Stream Socket: Used with TCP for reliable, connection-
oriented communication.
o Datagram Socket: Used with UDP for connectionless
communication.
3. Synchronization
Synchronization ensures that both sender and receiver are ready for
data transfer. It is achieved during the connection setup phase using the
SYN flag.
Summary Table:
Feature Description
Segment Format Defines the structure of the TCP header and
payload.
Sockets Endpoints for communication, combining
IP address and port number.
Synchronization Ensures readiness for data transfer during
connection setup.
Three-Way Process to establish a connection using
Handshaking SYN and ACK flags.
Variable Window Adapts to network conditions for efficient
Size flow control.
Timeout & Detects lost packets and adjusts
Retransmission retransmission using adaptive algorithms.
Connection Control Manages connection setup, maintenance,
and termination.
Silly Window Problem of inefficient packet size, solved
Syndrome with algorithms like Nagle’s.
Example of TCP
TCP has several variants designed to optimize performance in different
network conditions, particularly for congestion control. Below are the
key variants:
1. TAHO
1) TCP Tahoe
Overview:
TCP Tahoe is one of the earliest implementations of TCP congestion
control mechanisms. It introduced three critical techniques for
managing congestion:
Key Features:
1. Slow Start:
o Gradually increases the congestion window (cwnd) size to
avoid overwhelming the network.
2. Congestion Avoidance:
o When nearing network capacity, increases the cwnd more
slowly to maintain stability.
3. Fast Retransmit:
o Retransmits a packet upon receiving three duplicate ACKs,
reducing reliance on timeouts.
Limitation:
On detecting packet loss, it sets the congestion window size to 1
Maximum Segment Size (MSS) and restarts the Slow Start
phase, leading to a significant performance drop.
2. RENO
2) TCP Reno
Overview:
TCP Reno builds upon Tahoe by improving congestion recovery after
packet loss.
Key Features:
1. Slow Start and Congestion Avoidance:
o Same as in Tahoe.
2. Fast Recovery:
o Instead of returning to Slow Start after packet loss, Reno
enters the Fast Recovery phase, halving the congestion
window and then gradually increasing it.
o This allows Reno to recover faster than Tahoe.
Limitation:
Inefficient in networks with high packet loss, as it struggles to
handle multiple packet losses in a single window.
3. SACK etc
3) TCP SACK (Selective Acknowledgment)
Overview:
TCP SACK enhances Reno by addressing its limitation of handling
multiple packet losses.
Key Features:
1. Selective Acknowledgment:
o Allows the receiver to inform the sender about specific
segments that were successfully received, enabling the
sender to retransmit only the missing segments.
2. Improved Recovery:
o Efficiently recovers from multiple packet losses within a
single window.
Advantage:
Works well in high-bandwidth, high-latency networks or
networks prone to frequent packet loss.
Comparison Table:
UDP
UDP is a connectionless transport layer protocol used for fast, low-
overhead communication. Unlike TCP, it does not guarantee reliability,
ordering, or error recovery, making it ideal for real-time applications
like video streaming and online gaming.
1. Message encapsulation
Encapsulation in UDP involves placing data inside UDP packets,
which are then wrapped with IP headers for transmission. The process
includes:
1. Application Layer Data:
o Data is generated by the application (e.g., a video stream or
DNS query).
2. UDP Header:
o The UDP header, containing port numbers and basic
information, is added to the data.
3. IP Header:
o The IP header is attached, specifying source and destination
IP addresses for routing.
Encapsulation Process:
Application Data → UDP Header → IP Header → Data Link Layer
Frame
Example:
A DNS query is encapsulated as follows:
Application Data (query) → UDP Header → IP Header → Frame
(sent over Ethernet/Wi-Fi).