0% found this document useful (0 votes)
6 views18 pages

Wireless Mobile Computer

wireless mobile computer rgpv unit 4
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views18 pages

Wireless Mobile Computer

wireless mobile computer rgpv unit 4
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 18

UNIT 2

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.

1. BGO Concept of hiding network and autonomous system


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.

1) BGP Concept of Hiding Networks and Autonomous Systems:


 Autonomous Systems (AS):
o An AS is a collection of IP networks and routers managed
by a single organization or entity.
o Each AS is assigned a unique number, known as the
Autonomous System Number (ASN).
 Hiding Networks:
o BGP can be configured to aggregate routes and hide the
specific internal structure of an AS.
o Instead of advertising all individual subnets, the AS
announces a summarized prefix to external networks. This
reduces routing table size and protects internal topology
details.
Example:
An AS with subnets 192.168.1.0/24, 192.168.2.0/24, and
192.168.3.0/24 can advertise a single aggregated route: 192.168.0.0/22.
External networks cannot see the detailed subnets.
 Route Filtering:
o BGP can filter specific routes using policies to avoid
advertising certain networks to external peers, effectively
"hiding" them.
 Use Case:
o Enterprises or ISPs often use this feature to simplify route
advertisement and enhance security.

2. An exterior getaway protocol’s


 Exterior Gateway Protocols:
 EGPs are used for routing between different ASes on the internet.
 They focus on determining the best routes between ASes, as
opposed to Interior Gateway Protocols (IGPs), which operate
within an AS.
 Key Features of BGP (EGP):
1. Path Vector Protocol: Maintains complete path information (AS
paths) for each route.
2. Scalability: Handles the vast size of the internet's routing table.
3. Policy-Based Routing: Allows fine-grained control over route
selection using policies.
4. Reliability: Uses TCP (port 179) for reliable communication
Comparison with IGPs:
Feature IGPs (e.g., OSPF, RIP) EGPs (e.g., BGP)
Scope Within a single AS Between multiple
ASes
Protocol Type Link-state or distance- Path vector
vector
Scalability Limited High
Complexity Simple Complex

3. Different messages of BGP


BGP communicates through specific message types, all sent over TCP.
These messages are crucial for establishing and maintaining BGP
sessions and exchanging routing information.
1. Open:
o Sent to establish a BGP session between peers.
o Includes:
 ASN of the sender.
 BGP version.
 Hold time (maximum time to wait before sending a
Keepalive).
 Identifier (sender's IP).
2. Keepalive:
o Sent periodically to maintain the session.
o Ensures that the connection remains active without
exchanging routing updates.
o Default interval: 60 seconds.
3. Update:
o Used to advertise new routes or withdraw previously
advertised ones.
o Includes:
 Withdrawn Routes: Routes no longer available.
 Path Attributes: Metrics like AS path, next-hop, etc.
 Network Layer Reachability Information (NLRI):
Advertised prefixes.
4. Notification:
o Sent to terminate a BGP session due to an error or
misconfiguration.
o Includes an error code and details.
5. Route Refresh:
o Optional message to request a peer to resend its routing
table without tearing down the session.
Summary of Messages:
Message Type Purpose
Open Establish a connection between peers.
Keepalive Maintain an active BGP session.
Update Advertise new routes or withdraw old ones.
Notification Indicate errors and terminate the session.
Route Refresh Request updated routing information.

Interior getaway Protocols


Interior Gateway Protocols are used to determine the best routing paths
within a single Autonomous System (AS). IGPs are essential for
internal network routing, ensuring efficient and reliable data delivery
across devices within the same administrative domain.
1. RIP
Overview:
 RIP is a distance-vector routing protocol.
 It uses the hop count as a metric to determine the best path, with
a maximum hop count of 15 (16 indicates an unreachable
network).
 RIP is simple and easy to configure but not suitable for large
networks due to its limitations.
Key Features:
 Routing Updates: Sent every 30 seconds to all neighboring
routers.
 Protocol Version:
1. RIP v1: Classful, does not support subnetting or VLSM
(Variable-Length Subnet Masking).
2. RIP v2: Classless, supports subnetting and authentication.
 Convergence Time: Slow, as it depends on periodic updates.
Limitations:
 Inefficient in large networks due to limited hop count.
 Prone to routing loops; uses techniques like split horizon, route
poisoning, and hold-down timers to mitigate this.

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).

3. Multiplexing and port


Concept:
 Multiplexing in networking involves combining multiple data
streams into a single communication channel or link to maximize
resource utilization.
 It enables multiple devices or applications to share the same
physical medium efficiently.
Types of Multiplexing:
1. Time Division Multiplexing (TDM):
o Divides the channel into time slots.
o Each data stream gets a time slot, even if it has no data to
send.
o Commonly used in telecommunication systems.
2. Frequency Division Multiplexing (FDM):
o Assigns different frequency bands to different data streams.
o Each stream occupies a unique frequency range, preventing
interference.
o Example: Radio broadcasting.
3. Statistical Multiplexing:
o Dynamically allocates bandwidth to data streams based on
demand.
o More efficient than TDM, as unused bandwidth can be
reallocated.
4. Wavelength Division Multiplexing (WDM):
o Used in optical networks.
o Combines multiple data streams by assigning different
wavelengths of light to each.
Application in Routing:
 Multiplexing ensures efficient use of network resources by
managing multiple data flows, especially in high-bandwidth
environments like MPLS (Multiprotocol Label Switching) and
backbone networks.
 Comparison: RIP vs. OSPF

Aspect RIP OSPF


Protocol Type Distance-vector Link-state
Metric Hop count Cost (based on bandwidth)
Scalability Limited to small networks Suitable for large networks
Convergence Time Slow Fast
Routing Updates Periodic Triggered
Authentication Basic (RIP v2) Strong (MD5, etc.)

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.

4. Three ways hand shaking


The process for establishing a TCP connection involves three steps:
1. SYN (Synchronize):
o The client sends a TCP segment with the SYN flag set to
initiate a connection and specify an initial sequence number.
2. SYN-ACK (Synchronize + Acknowledge):
o The server responds with a segment that has both SYN and
ACK flags set, acknowledging the client's SYN request and
sending its own sequence number.
3. ACK (Acknowledge):
o The client sends a segment with the ACK flag set,
acknowledging the server's SYN-ACK.

5. Variable window size and flow control


Flow Control: Ensures that a sender does not overwhelm the receiver
with too much data at once.

Sliding Window Protocol:


The sender maintains a window of bytes it can send without waiting for
acknowledgment.
The receiver advertises its window size in the TCP header.
The sender adjusts its transmission based on the receiver's available
buffer space.
Variable Window Size:

The window size changes dynamically based on network conditions


and receiver capacity, optimizing throughput.
6. Time out and retransmission algorithm
Timeout:
TCP uses a retransmission timeout (RTO) to detect lost packets.
If an acknowledgment (ACK) is not received within the timeout period,
the segment is retransmitted.
Retransmission Algorithm:
Exponential Backoff: Retransmission intervals double after each
failure.
Adaptive RTO Calculation: RTO is based on measured round-trip
time (RTT) and its variation.
Formula:
RTO = SRTT (Smoothed RTT) + 4 * RTTVAR (RTT variation)
7. Connection control
Connection Establishment:
Uses the three-way handshake to establish a reliable connection.
Connection Termination:
Involves a four-step process with FIN and ACK flags:
FIN: Sender requests to close the connection.
ACK: Receiver acknowledges the FIN.
FIN: Receiver sends a FIN to close its side.
ACK: Sender acknowledges the receiver's FIN.
8. Silly window syndrome
 Problem:
o Occurs when the receiver advertises a very small window
size, causing inefficient use of the network by sending small
packets.
 Causes:
o The receiver has limited buffer space or releases buffer
space slowly.
o The sender transmits small segments unnecessarily.
 Solutions:
1. Clark’s Solution:
The receiver delays sending window updates until it can advertise a
larger window.
2. Nagle’s Algorithm:
The sender waits until it can send a full-sized segment or receives an
acknowledgment.

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.

 This detailed understanding of TCP helps ensure reliable and


efficient data transmission in networks.

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:

Feature TCP Tahoe TCP Reno TCP SACK


Congestion Slow Start, Adds Fast Uses Selective
Control Congestion Recovery Acknowledgment for
Avoidance, efficient
Fast retransmission
Retransmit
Packet Loss Restarts with Halves Handles multiple
Handling Slow Start cwnd and losses efficiently
recovers
faster
Performance Poor with Better than Best for networks
frequent losses Tahoe with high losses
Conclusion
 TCP Tahoe introduced foundational concepts of congestion
control.
 TCP Reno improved recovery performance after packet loss.
 TCP SACK is highly efficient for modern networks with
frequent or multiple packet losses.
Choosing the right TCP variant depends on the network
conditions and application requirements.

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).

2. Format and pseudo headers


UDP Header Format:
The UDP header is minimal, consisting of only 8 bytes.
Field Size Description
Source Port 16 Identifies the sender's port.
bits
Destination 16 Identifies the receiver's port.
Port bits
Length 16 Specifies the total size of the UDP packet
bits (header + data).
Checksum 16 Ensures the integrity of the UDP packet by
bits detecting errors in transmission.
Pseudo Header:
The pseudo header is not part of the UDP packet itself but is used
during checksum computation. It provides additional information to
ensure data integrity at the transport layer.
Pseudo Header Fields:
1. Source IP Address: Ensures the packet originates from the
correct host.
2. Destination IP Address: Verifies the packet is sent to the
intended host.
3. Protocol Field: Indicates the protocol (UDP = 17).
4. UDP Length: Matches the value in the UDP header's length field.
The Checksum is computed over the UDP header, payload, and pseudo
header, ensuring end-to-end integrity of the data.
UDP Header and Pseudo Header Structure
UDP Header:
| Source Port (16 bits) | Destination Port (16 bits) | UDP Length (16
bits) | Checksum (16 bits) |
Pseudo Header (for Checksum Calculation):
| Source IP Address (32 bits) | Destination IP Address (32 bits) |
| Protocol (8 bits) | Reserved (8 bits) | UDP Length (16 bits) |
Summary
Feature Description
Message Wraps application data with a UDP header and
Encapsulation an IP header for transmission.
UDP Header Includes source port, destination port, length,
Fields and checksum (8 bytes total).
Pseudo Header Additional fields (IP addresses, protocol,
length) used for checksum calculation to ensure
integrity.
UDP’s simplicity and low overhead make it ideal for applications
where speed is more critical than reliability, such as DNS lookups,
VoIP, and online gaming.

You might also like