Unit - 1 Computer Networks and OSI Model
Thursday, February 22, 2024 8:18 PM
Computer networks and its components
Computer networks are systems that allow multiple computers and other devices to communicate and share resources with each ot her. They enable the exchange of data and
information between connected devices, facilitating tasks such as file sharing, communication, and resource sharing.
Components of a computer network include
1. Nodes: These are the devices connected to the network, such as computers, servers, printers, switches, routers, and other networking devices.
2. Links: Links are the physical connections that allow data to travel between nodes. They can be wired, such as Ethernet cables or fiber-optic cables, or wireless, such as Wi-
Fi or Bluetooth connections.
3. Networking Devices: These devices facilitate communication within the network. Examples include routers, switches, hubs, and access points. Routers connect multiple
networks together and determine the best path for data to travel between them. Switches manage the flow of data within a network, directing data to its intended
destination. Hubs, though less common now, are used to connect multiple devices in a network. Access points enable wireless devices to connect to the network.
4. Protocols: Protocols are rules and conventions that govern how data is transmitted and received in a network. Examples include TCP/IP (T ransmission Control
Protocol/Internet Protocol), which is the foundation of the internet, and HTTP (Hypertext Transfer Protocol), which is used f or transferring web pages.
5. Network Operating Systems (NOS): These are specialized operating systems designed to support network functionality. They provide services such as file sharing, printer
sharing, user authentication, and access control.
Computer networks are essential for various reasons:
1. Resource Sharing: Networks enable the sharing of resources such as files, printers, and internet connections among multiple users, increasing efficiency and reducing
costs.
2. Communication: Networks facilitate communication through email, instant messaging, video conferencing, and other forms of electronic commu nication.
3. Collaboration: Networks allow multiple users to work together on projects and documents in real-time, regardless of their physical location.
4. Centralized Management: Networks enable centralized management of resources, allowing administrators to monitor and control access to data and devices from a single
location.
5. Information Access: Networks provide access to vast amounts of information and resources available on the internet, enabling users to access in formation quickly and
easily.
Network Topologies
Network topologies refer to the physical or logical layout of devices and connections in a computer network. Each topology has its own advantages and disadvantages, and the
choice of topology depends on factors such as the size of the network, the types of devices being connected, and the intended purpose of the network. Here are some
common network topologies:
a. Bus Topology:
▪ Description: It is a multipoint connection in which every node/device is connected to a single cable (Backbone cable) via drop lines. Bus topology consists of two
ends and data is transmitted from one end to another in a single direction i.e., bus topology is unidirectional. Terminators are used at the end of the cable so that
the electrical signal does not bounce back.
▪ Advantages:
□ Simple to implement and cost-effective, especially for small networks.
□ Requires less cabling than some other topologies, reducing installation costs.
▪ Disadvantages:
□ Single point of failure: If the backbone cable is damaged or fails, the entire network can go down.
□ Limited scalability: Adding more devices can degrade performance due to signal degradation and increased collisions.
b. Ring Topology:
▪ Description: In a ring topology, each device is connected to exactly two other devices, forming a circular loop. Data travels in one direction around the ring,
passing through each device until it reaches its destination.
▪ Advantages:
□ Equal access: Each device has equal access to the network resources since data circulates around the ring.
□ Efficiency: Data collisions are minimized as devices only transmit when they receive a token, ensuring orderly data transmission.
▪ Disadvantages:
□ Single point of failure: If one device or connection fails, the entire network can be disrupted.
□ Limited scalability: Adding more devices can increase latency and decrease network performance.
c. Star Topology:
▪ Description: In a star topology, all devices are connected to a central hub or switch, forming a star-like structure. Data traffic flows through the central hub, which
manages the communication between devices.
▪ Advantages:
□ Centralized management: Easy to manage and troubleshoot as all devices connect to a central point.
□ Fault tolerance: If one connection fails, only the affected device is disconnected, while the rest of the network remains operational.
▪ Disadvantages:
□ Dependency on central device: If the central hub or switch fails, the entire network can go down.
□ Cost: Requires more cabling than some other topologies due to point-to-point connections between the central device and each node.
d. Mesh Topology:
▪ Description: In a mesh topology, each device is connected to every other device in the network, creating multiple redundant paths. Data can travel through
various routes, increasing reliability and fault tolerance.
▪ Advantages:
□ Redundancy: Multiple paths between nodes ensure that if one path fails, data can still reach its destination.
□ Fault tolerance: Can withstand multiple failures without disrupting network connectivity.
▪ Disadvantages:
□ Cost: Requires more cabling and networking equipment than other topologies, making it more expensive to implement and maintain.
□ Complexity: More difficult to set up and manage due to numerous connections between nodes.
e. Tree Topology:
▪ Description: Tree topology combines characteristics of bus and star topologies. It consists of multiple star topologies connected together in a hierarchical
structure. Devices are connected to central hubs, which are then connected to a main backbone.
▪ Advantages:
□ Scalability: Can accommodate a large number of devices and is suitable for expanding networks.
□ Centralized management: Allows for easy management and troubleshooting, similar to star topology.
Disadvantages:
Computer Networks Page 1
▪ Disadvantages:
□ Dependency on central hubs: If a central hub fails, all devices connected to it lose connectivity.
□ Cost: Requires more cabling and networking equipment than star topology due to multiple levels of hierarchy.
Types of Networks
• LAN (Local Area Network):
○ Description: A LAN is a network that covers a small geographical area, typically within a single building or campus. It connects devices such as computers, printers, and
servers, allowing them to communicate and share resources.
○ Examples:
▪ Home network: A LAN in a household connecting computers, smartphones, printers, and other devices.
▪ Office network: A LAN in an office building connecting workstations, servers, and printers for internal communication and resource sharing.
▪ School or university network: A LAN within a school campus or university connecting computers in classrooms, labs, libraries, and administrative offices.
• MAN (Metropolitan Area Network):
○ Description: A MAN is a network that covers a larger geographical area than a LAN but smaller than a WAN, typically spanning a city or metropolitan area. It connects multiple
LANs and may also include high-speed connections between different locations within the same city.
○ Examples:
▪ City-wide network: A MAN connecting multiple office buildings, campuses, or government facilities across a city.
▪ Cable TV network: Some cable TV networks also function as MANs, providing high-speed internet access and other services to subscribers within a city.
▪ Municipal network: A MAN deployed by a municipality to provide public services such as internet access, CCTV surveillance, and traffic management.
• WAN (Wide Area Network):
○ Description: A WAN is a network that covers a large geographical area, typically spanning multiple cities, countries, or even continents. It connects multiple LANs and MANs
over long distances, often using leased lines or telecommunications links.
○ Examples:
▪ Internet: The largest WAN in existence, connecting millions of networks, devices, and users worldwide.
▪ Corporate network: A WAN connecting multiple branch offices, data centers, and remote workers across different cities or countries.
Global financial networks: WANs used by financial institutions for transactions, trading, and communication between branches and partners worldwide.
Transmission Modes
Simplex Transmission:
Description: In simplex transmission, data is transmitted in only one direction, and communication can occur in one-way only. One device is the transmitter, and the other is
the receiver, with no capability for both devices to transmit and receive simultaneously.
Example:
Television broadcast: TV signals are transmitted from broadcasting stations to TV receivers. The TV stations continuously transmit signals, and the viewers only receive the
broadcast; they cannot send any data back to the station.
Half-Duplex Transmission:
Description: In half-duplex transmission, data can be transmitted in both directions, but not simultaneously. Communication can occur in both directions, but not at the same
time. Devices take turns transmitting and receiving data.
Example:
Two-way radios (walkie-talkies): Users can speak and listen alternately, but they cannot talk and listen simultaneously. When one person is talking, the other must listen,
and vice versa.
Full-Duplex Transmission:
Description: In full-duplex transmission, data can be transmitted in both directions simultaneously. This allows devices to send and receive data at the same time, enabling
faster and more efficient communication.
Example:
Computer Networks Page 2
Example:
Telephone conversation: In a traditional telephone call, both parties can talk and listen simultaneously, allowing for real-time two-way communication. Each person can
speak and hear the other person's response without waiting for turns.
Broadcast,Unicast,Multicast and anycast networks
○ Broadcast Network:
○ Description: In a broadcast network, a single message is sent from one sender to all devices within the network. All devices on the network receive the same message
simultaneously.
○ Example:
▪ Local Area Network (LAN): In a LAN environment, when a device broadcasts a message, such as an ARP (Address Resolution Protocol) request for MAC address
resolution, all devices on the same LAN segment receive and process the broadcast message.
○ Unicast Network:
○ Description: In a unicast network, a message is sent from one sender to a specific recipient device. The communication is one-to-one, with a unique message sent to each
destination.
○ Example:
▪ Web Browsing: When you access a website using a web browser, your computer sends a unicast request to the web server hosting the website. The server responds
with a unicast reply, delivering the requested web page specifically to your device.
○ Multicast Network:
○ Description: In a multicast network, a message is sent from one sender to multiple specific recipient devices that have expressed interest in receiving the message. The
communication is one-to-many, but not all devices on the network necessarily receive the message.
○ Example:
▪ Internet Protocol (IP) Television (IPTV): In IPTV services, multicast technology is often used to stream video content. The video stream is sent from the IPTV server to
multiple subscriber devices simultaneously, but only to those devices that have requested to receive that particular channel.
○ Anycast Network:
○ Description: In an anycast network, a message is sent from one sender to the nearest available destination among a group of potential recipients. The communication is
one-to-one, but the destination is the "closest" device in terms of network topology or routing metrics.
○ Example:
▪ Domain Name System (DNS): DNS servers use anycast routing to optimize performance and availability. When a client device sends a DNS query, it is route d to the
nearest DNS server in terms of network distance or routing metrics, ensuring faster response times and improved reliability.
OSI Model
The Open System Interconnection (OSI) model is a conceptual model developed by the International Standards Organization (ISO) in 1984. The OSI model provides a standard
for communication between different/diverse computer systems.
The OSI model has seven layers in which each layer has a specific set of functions and communicates with the layer above and below itself.
Layers of OSI model
Physical Layer:
The physical layer is the lowest layer of the OSI model. It is responsible for transmitting message bits over a medium and it also takes care of mechanical, electrical, procedural,
and functional specifications for communication.
Functions:
• Transmission mode: It defines a transmission mode from Simplex, half-duplex, and full-duplex.
• Network Topology: It specifies the arrangement of devices in a network.
• Physical characteristics of the transmission medium
• Line Configuration: It selects from either point-to-point or multipoint line configuration.
• Data Rate: The physical layer defines the number of bits transmitted per unit of time.
Data Link Layer(DLL):
The data link layer breaks data packets received from the network layer into smaller pieces called frames and is responsible for the error-free transmission of these frames from
one node to another using its MAC address.
The DLL is divided into two sublayers:
• LLC(Logical Link Control): It deals with functions like flow control and error control.
• MAC(Media Access Control): It controls the physical addressing and framing functions of the data link layer.
Functions:
• Flow Control: It makes sure that the transmitting speed and the amount of data sent to match the capacity and speed of the receiver so that no data gets corrupted.
• Framing: DLL adds certain bits at the beginning(called header which contains the source and destination addresses) and at the end(called trailer which contains error
correction and detection bits) to the message frame.
• Error Control: DLL uses CRC(cyclic redundancy check) to check if any error occurred during transmission.
• Physical Addressing: DLL adds the physical address(MAC address) of the destination and source in the header of each frame.
• Access Control: Determines which device has control over the link if the same communication channel is shared by multiple devices.
Network Layer:
The network layer is responsible for finding the best path for the delivery of data packets from the source host to the destination host.
Functions:
• Host-to-host connectivity.
• Fragmentation: The network layer divides the received data into smaller fragments called packets.
• Routing: The network layer is responsible for finding the best possible path for a data packet to reach its destination, this is known as routing.
• Logical Addressing: The network layer adds the source and destination’s IP address(which is used to identify a device uniquely universally) in the header of the frame.
Transport Layer:
The purpose of the transport layer is to provide a mechanism for the delivery of a message from one to another process and ensure that the data units are delivered sequentially,
without error, and without loss or duplication.
Functions
• Service Point Addressing: To ensure that the message is sent to the appropriate process the transport layer header includes an address type known as the service point
address or port address.
• Segmentation and Reassembly: The transport layer receives a message from the session layer, divides it into smaller pieces called segments, and assigns each segment a
sequence number that uniquely identifies that segment, and at the destination transport layer reassembles the message based on their sequence numbers.
• Flow Control: The transport layer ensures the speed at which data is sent corresponds to the speed at which data is received.
• Error Control: The transport layer performs error control to ensure that data reached its destination without any error.
Session Layer:
This is the layer in charge of initiating and terminating communication between the two devices. The session is the period between the start and end of the communication.
Computer Networks Page 3
This is the layer in charge of initiating and terminating communication between the two devices. The session is the period between the start and end of the communication.
Functions
• Dialog Control: It means communication between two processes can take place in either a half-duplex or full-duplex way.
• Synchronization: The session layer allows adding some checkpoints while transmitting data so that if a failure of some kind occurs between checkpoints, all data can be
retransmitted from the most recent checkpoint.
6. Presentation Layer:
The presentation layer converts the information from the application layer into a suitable format for network transmission.
Functions
• Translation: Convert the information sent by the sender into a common format so that it can be understood by the receiver.
• Encryption/Decryption: The process of converting an original message into another format for secure transmission is called encryption and obtaining the original message
from the encrypted message is called decryption. Key values are used to encrypt and decrypt data.
• Compression: Reducing the number of bits in the message to be transmitted.
Application Layer:
The application layer allows users to access network resources. The application layer is the OSI layer closest to the end-user.
Functions
• File transfer, access, and management (FTAM): It allows a user to access, manage and retrieve files on a remote computer.
• Mail Services
• Directory Services: This layer provides access to global information for various services.
Network Protocols
1. FTP (File Transfer Protocol):
○ Description: FTP is a standard network protocol used for transferring files between a client and a server on a computer network. It allows users to upload, download, and
manage files on a remote server.
○ OSI Layers: FTP operates at the Application layer (Layer 7) of the OSI model. It uses TCP (Transmission Control Protocol) for reliable data transfer and typically runs on port 21
(for command/control) and port 20 (for data transfer).
2. SMTP (Simple Mail Transfer Protocol):
○ Description: SMTP is a protocol used for sending and relaying email messages between email servers. It defines the rules and procedures for transferring emails over the
internet.
○ OSI Layers: SMTP operates primarily at the Application layer (Layer 7) of the OSI model. It uses TCP for reliable communication and typically runs on port 25. However, SMTP
can also use alternative ports such as 587 for secure communication (SMTPS) or 465 for legacy SSL/TLS-encrypted SMTP.
3. HTTP (Hypertext Transfer Protocol):
○ Description: HTTP is a protocol used for transmitting hypermedia documents, such as HTML web pages, over the internet. It defines the structure and semantics of web
communication.
○ OSI Layers: HTTP operates at the Application layer (Layer 7) of the OSI model. It uses TCP for communication and typically runs on port 80 for unencrypted communication or
port 443 for encrypted communication (HTTPS, Hypertext Transfer Protocol Secure, which uses SSL/TLS).
4. DNS (Domain Name System):
○ Description: DNS is a protocol used for translating domain names (e.g., [Link]) into IP addresses and vice versa. It enables users to access websites using human-
readable domain names instead of numerical IP addresses.
○ OSI Layers: DNS operates at the Application layer (Layer 7) of the OSI model. It uses both UDP (User Datagram Protocol) and TCP for communication. DNS queries usually
occur over UDP on port 53, while DNS zone transfers and large responses may use TCP.
5. DHCP (Dynamic Host Configuration Protocol):
○ Description: DHCP is a protocol used for dynamically assigning IP addresses and network configuration parameters to devices on a network. It automates the process of IP
address allocation, subnet mask assignment, default gateway configuration, and DNS server configuration.
○ OSI Layers: DHCP operates at the Application layer (Layer 7) of the OSI model. It uses UDP for communication and typically runs on port 67 for DHCP server communication
and port 68 for DHCP client communication.
6. TCP (Transmission Control Protocol):
○ Description: TCP is a connection-oriented protocol used for reliable, ordered, and error-checked delivery of data between devices over a network. It provides features such as
flow control, error detection, and congestion avoidance.
○ OSI Layers: TCP operates at the Transport layer (Layer 4) of the OSI model. It ensures the reliable transmission of data packets between source and destination devices by
establishing a connection, acknowledging received data, and retransmitting lost or corrupted packets.
7. UDP (User Datagram Protocol):
○ Description: UDP is a connectionless protocol used for sending datagrams (packets) between devices over a network. Unlike TCP, UDP does not provide reliability or error
correction mechanisms, making it faster but less reliable.
○ OSI Layers: UDP also operates at the Transport layer (Layer 4) of the OSI model. It provides a simple and lightweight mechanism for transmitting data packets without
establishing a connection or ensuring reliability.
8. IMAP (Internet Message Access Protocol):
○ Description: IMAP is a protocol used by email clients to retrieve emails from a mail server. It allows users to access and manage email messages stored on the server while
keeping the messages synchronized across multiple devices.
○ OSI Layers: IMAP operates at the Application layer (Layer 7) of the OSI model. It uses TCP for communication and typically runs on port 143 for unencrypted communication
or port 993 for encrypted communication (IMAPS).
9. POP3 (Post Office Protocol version 3):
○ Description: POP3 is a protocol used for retrieving emails from a remote mail server to a local client device. It downloads emails from the server to the client's device and
typically deletes them from the server after retrieval.
○ OSI Layers: POP3 operates at the Application layer (Layer 7) of the OSI model. It also uses TCP for communication and typically runs on port 110 for unencrypted
communication or port 995 for encrypted communication (POP3S).
10. Telnet:
○ Description: Telnet is a protocol used for remote terminal access to devices over a network. It allows users to establish a remote terminal session on a remote server or
networking device, enabling command-line access and management.
○ OSI Layers: Telnet operates at the Application layer (Layer 7) of the OSI model. It uses TCP for communication and typically runs on port 23. However, Telnet is considered
insecure due to its lack of encryption, and SSH (Secure Shell) is often used instead for secure remote access.
TCP Model
the TCP/IP model is more commonly used and implemented in practice, especially in the context of the Internet. The OSI model, on the other hand, offers a more detailed and
comprehensive framework but is less commonly implemented.
Layers of TCP model
Computer Networks Page 4
Layers of TCP model
Physical Layer
• The physical layer translates message bits into signals for transmission on a medium, i.e. the physical layer is the place where the real communication takes place.
• Signals are generated depending on the type of media used to connect two devices. For example, electrical signals are generated for copper cables, light signals are generated
for optical fibers, and radio waves are generated for air or vacuum.
• Physical layer also specifies characteristics like topology(bus,star,hybrid,mesh,ring), line configuration(point-to-point, multipoint) and transmission mode(simplex, half-duplex,
full-duplex).
Data Link Layer(DLL)
• The DLL is subdivided into 2 layers: MAC(Media Access Control), LLC(Logical Link Control)
• The MAC layer is responsible for data encapsulation(Framing) of IP packets from the network layer into frames. Framing means DLL adds a header(which contains the MAC
address of source and destination) and a trailer(which contains error-checking data) at the beginning and end of IP packets.
• LLC deals with flow control and error control. Flow control: Limits how much data a sender can transfer without overwhelming the receiver. Error Control: Error in the data
transmission can be detected by checking the error detection bits in the trailer of the frame.
Network Layer
The network layer adds IP address/logical address to the data segments to form IP packets and finds the best possible path for data delivery. IP addresses are addresses allocated
to a device to uniquely identify it on a global scale. Common protocols used in the Network layer are
• IP(Internet Protocol): IP uses the receiver’s IP address to determine the best path for the proper delivery of packets to the destination. When a packet is too large to send over
a network medium, the sender host’s IP splits it up into smaller fragments. The fragments are reassembled into the original packet on the receiving host. IP is unreliable since
it does not ensure delivery or check for errors.
• ARP(Address Resolution Protocol): ARP is used to find MAC/physical Addresses from the IP address.
• ICMP(Internet Control Message Protocol): ICMP is responsible for error reporting.
Transport Layer
The transport layer is in charge of flow control (controlling the rate at which data is transferred), end-to-end connectivity, and error-free data transmission. Protocols used in the
Transport layer:
• TCP(Transmission Control Protocol):
• TCP is a connection-oriented protocol, which means it requires the formation and termination of connections between devices in order to transmit data.
• TCP segmentation means that at the sending node, TCP breaks the entire message into segments, assigns a sequence number to each segment, then reassembles the
segments into the original message at the receiving end based on the sequence numbers.
• TCP is a reliable protocol because it identifies errors and retransmits the damaged frames, and ensures data delivery in the correct order.
• UDP(User Datagram Protocol):
• UDP is a connectionless protocol, which means it does not require the establishment and termination of connections between devices.
• UDP does not support segmentation and lacks error checking and correction which makes it less reliable but more cost-efficient.
Application Layer
This is the uppermost layer, which combines the OSI model’s session, presentation, and application layers. Users can interact with the application and access network resources
through this layer.
Protocols used in the Application layer:
• HTTP(Hypertext Transfer Protocol): Protocol used to access data on the World Wide Web.
• DNS(Domain Name System): This protocol translates domain names to IP addresses.
• SMTP(Simple Mail Transfer Protocol): This protocol is used to send Email messages.
• FTP(File Transfer Protocol): This protocol is used to transfer files between computers.
• TELNET(Telecommunication Network): It is a two-way communication protocol connecting a local machine to a remote machine.
Network Devices
1. Hub:
○ Description: A hub is a basic networking device that connects multiple devices in a network. It operates at the physical layer (Layer 1) of the OSI model and simply
forwards data packets to all devices connected to it.
○ Application:
▪ Used in small or legacy networks to connect devices together, such as computers, printers, and servers.
▪ Suitable for simple networks where data collision and network congestion are not significant concerns.
▪ Less commonly used in modern networks due to its limitations in handling traffic and its inability to segment network traffic.
2. Repeater:
○ Description: A repeater is a network device used to regenerate or amplify signals in a network. It operates at the physical layer (Layer 1) of the OSI model and extends the
reach of network signals by boosting their strength.
○ Application:
▪ Used to extend the range of network connections by amplifying weak signals and compensating for signal degradation over long distances.
▪ Commonly used in large networks or environments with long cable runs, such as in buildings or across campuses.
▪ Helps maintain signal integrity and minimize data loss or corruption in network transmissions.
3. Bridge:
○ Description: A bridge is a network device used to connect two or more network segments together. It operates at the data link layer (Layer 2) of the OSI model and
selectively forwards data packets between network segments based on MAC addresses.
○ Application:
▪ Used to divide larger networks into smaller segments to reduce network congestion and improve overall performance.
▪ Helps isolate network traffic within segments, preventing unnecessary broadcast traffic from propagating throughout the entire network.
▪ Commonly used in Ethernet networks to create separate collision domains and improve network efficiency.
4. Switch:
○ Description: A switch is a network device used to connect multiple devices in a network. It operates at the data link layer (Layer 2) of the OSI model and forwards data
packets between devices based on MAC addresses.
○ Application:
▪ Used in modern Ethernet networks to provide high-speed, full-duplex communication between devices.
▪ Offers improved performance and efficiency compared to hubs by creating separate collision domains for each port.
▪ Supports features such as VLANs (Virtual Local Area Networks) for network segmentation, QoS (Quality of Service) for prioritizing traffic, and port security for
controlling access to network resources.
5. Router:
○ Description: A router is a network device used to connect multiple networks together and route data packets between them. It operates at the network layer (Layer 3) of
the OSI model and uses IP addresses to determine the best path for forwarding packets.
○ Application:
▪ Used to interconnect LANs, WANs, and the Internet, allowing devices in different networks to communicate with each other.
Computer Networks Page 5
▪ Used to interconnect LANs, WANs, and the Internet, allowing devices in different networks to communicate with each other.
▪ Performs functions such as packet forwarding, routing table management, and network address translation (NAT) to facilitate communication between disparate
networks.
▪ Provides security features such as firewalling, access control lists (ACLs), and VPN (Virtual Private Network) support to protect network resources and ensure secure
communication.
6. Gateway:
○ Description: A gateway is a network device or software component that serves as an entry and exit point between two different networks with different communication
protocols. It operates at the higher layers of the OSI model and translates data between incompatible networks.
○ Application:
▪ Used to connect networks with different protocols or technologies, such as connecting an Ethernet LAN to the Internet via a DSL modem.
▪ Translates data formats, protocols, and addressing schemes between networks, allowing devices in one network to communicate with devices in another network
seamlessly.
▪ Often used in enterprise networks, data centers, and cloud environments to facilitate interoperability between diverse network infrastructures.
IP address vs MAC address
IP address and MAC address are both addressing mechanisms used in computer networks, but they serve different purposes and operate at different layers of the networking
model. Here's a comparison between IP address and MAC address:
IP Address (Internet Protocol Address):
1. Layer: IP addresses operate at the network layer (Layer 3) of the OSI or TCP/IP model.
2. Purpose: IP addresses are used for logical addressing and routing of data packets across different networks.
3. Scope: IP addresses are globally unique and are used for communication over the internet or across interconnected networks.
4. Format: IP addresses are represented in a hierarchical format, with IPv4 addresses consisting of 32 bits (e.g., [Link]) and IPv6 addresses consisting of 128 bits (e.g.,
2001:0db8:85a3:0000:0000:8a2e:0370:7334).
Computer Networks Page 6
2001:0db8:85a3:0000:0000:8a2e:0370:7334).
5. Assignment: IP addresses are typically assigned by network administrators, Internet Service Providers (ISPs), or through dynamic assignment protocols like DHCP.
6. Portability: IP addresses are independent of the physical network interface and can be assigned to different devices or interfaces.
MAC Address (Media Access Control Address):
1. Layer: MAC addresses operate at the data link layer (Layer 2) of the OSI model.
2. Purpose: MAC addresses are used for physical addressing and identifying devices on a local area network (LAN).
3. Scope: MAC addresses are uniquely assigned to network interface cards (NICs) by the manufacturer and are used for communication within the same broadcast domain or
LAN segment.
4. Format: MAC addresses are represented in a hexadecimal format, consisting of 48 bits (e.g., 00:1A:2B:3C:4D:5E) or 64 bits (e.g., for Ethernet).
5. Assignment: MAC addresses are permanently burned into the NIC during manufacturing and cannot be manually assigned or changed by users.
6. Portability: MAC addresses are tied to the physical network interface and are not portable across different devices or interfaces.
In summary, IP addresses are used for logical addressing and routing data across interconnected networks, while MAC addresses are used for physical addressing and identifying
devices within a local network segment. IP addresses are globally unique and allow communication over the internet, whereas MAC addresses are unique within a broadcast
domain and facilitate communication within a LAN.
When sending data over a network, both IP and MAC addresses are used in the packet headers. The IP address determines the logical destination of the packet, while the MAC
address identifies the physical destination on the local network segment. Routers and switches use IP addresses for routing decisions, while switches and network interface cards
use MAC addresses for forwarding frames within the local network.
Computer Networks Page 7
Unit-2 Datalink layer in depth
Wednesday, February 14, 2024 5:09 PM
Stop-and-Wait ARQ (Automatic Repeat reQuest) is a type of error control protocol used in data
communication over a noisy channel. In a noisy channel, errors may occur during transmission due to factors
like interference, distortion, or signal attenuation. Stop-and-Wait ARQ is a simple and reliable method for
ensuring data integrity by detecting and correcting errors.
Here's how Stop-and-Wait ARQ works in a noisy channel:
1. Sender (Transmitter):
○ The sender divides the data into smaller frames or packets.
It sends one packet at a time to the receiver and waits for an acknowledgment (ACK) before sending
Computer Networks Page 1
communication over a noisy channel. In a noisy channel, errors may occur during transmission due to factors
like interference, distortion, or signal attenuation. Stop-and-Wait ARQ is a simple and reliable method for
ensuring data integrity by detecting and correcting errors.
Here's how Stop-and-Wait ARQ works in a noisy channel:
1. Sender (Transmitter):
○ The sender divides the data into smaller frames or packets.
○ It sends one packet at a time to the receiver and waits for an acknowledgment (ACK) before sending
the next packet.
○ After sending a packet, the sender starts a timer to wait for the ACK from the receiver.
2. Receiver:
○ The receiver receives the packet and checks it for errors using error detection techniques such as
checksum or CRC (Cyclic Redundancy Check).
○ If the packet is error-free, the receiver sends an ACK to the sender indicating successful reception.
○ If the packet contains errors, the receiver discards it and does not send an ACK.
3. Sender (Transmitter):
○ Upon receiving the ACK, the sender stops the timer and sends the next packet, if any.
○ If the sender does not receive an ACK within a specified timeout period, it assumes that the packet
was lost or corrupted during transmission and retransmits the same packet.
4. Receiver:
○ Upon receiving a packet, the receiver checks for errors and discards any duplicate packets.
○ If the receiver receives a duplicate packet (due to retransmission), it sends an ACK for the duplicate
packet.
This process continues until all packets have been successfully transmitted and acknowledged.
Go-Back-N Automatic Repeat reQuest (ARQ) is a type of error control protocol used in data
communication over a noisy channel, particularly in the context of sliding window protocols. It is an
enhanced version of the Stop-and-Wait ARQ protocol and is designed to improve efficiency by allowing the
sender to transmit multiple packets before waiting for acknowledgments.
Here's how Go-Back-N ARQ works:
1. Sender (Transmitter):
○ The sender divides the data into smaller frames or packets and assigns a sequence number to each
packet.
○ It sends multiple packets (a window of packets) consecutively without waiting for individual
acknowledgments.
○ The sender maintains a timer for the entire window of packets.
2. Receiver:
○ The receiver receives the packets and checks them for errors using error detection techniques.
○ If a packet is received successfully and in sequence, the receiver sends an acknowledgment (ACK) for
the highest correctly received packet.
○ If a packet is received out of sequence or contains errors, the receiver discards the packet and does
not send an ACK.
3. Sender (Transmitter):
○ Upon receiving an ACK for the entire window, the sender advances the window to the next sequence
number and continues sending the next window of packets.
○ If the sender does not receive an ACK within a specified timeout period, it assumes that one or more
packets in the window were lost or corrupted during transmission.
○ In this case, the sender retransmits all packets in the current window, starting from the oldest
unacknowledged packet.
Advantages of Go-Back-N ARQ:
• Improved efficiency: Allows the sender to transmit multiple packets without waiting for individual
acknowledgments, leading to higher throughput compared to Stop-and-Wait ARQ.
• Simple implementation: Go-Back-N ARQ is relatively simple to implement compared to other sliding
window protocols.
Disadvantages of Go-Back-N ARQ:
• Limited window size: The sender's window size is fixed, and if the window size is too large, it may lead to
increased buffer requirements and retransmissions in case of errors.
• Inefficient retransmissions: If any packet within a window is lost or corrupted, the sender must
retransmit all packets in the window, even if only a few packets were affected.
• Increased network congestion: Retransmitting multiple packets simultaneously upon a single error may
lead to increased network congestion and inefficient use of network resources.
The concept of cumulative acknowledgment means that the receiver acknowledges not only the receipt of
the latest packet but also all previously received packets up to a certain sequence number. This approach
simplifies the acknowledgment process and reduces the overhead associated with sending individual
acknowledgments for each packet.
For example, if the receiver receives packets with sequence numbers 1, 2, and 3 successfully but packet 4 is
lost, it sends an ACK for packet 4, indicating that it has received packets 1, 2, and 3 successfully. This
cumulative ACK informs the sender that it can advance the window beyond packet 4 for further transmission.
Selective Repeat Automatic Repeat reQuest (ARQ) is a type of error control protocol used in
data communication over a noisy channel. It is an enhancement of Go-Back-N ARQ and provides greater
efficiency by allowing the receiver to selectively acknowledge correctly received packets and discard
duplicate or out-of-sequence packets. Selective Repeat ARQ maintains multiple buffers at both the sender
and receiver to store transmitted and received packets until they are successfully acknowledged.
Here's how Selective Repeat ARQ works:
1. Sender (Transmitter):
○ The sender maintains a window of sequence numbers representing the packets that can be sent.
It sends multiple packets within the window consecutively, similar to Go-Back-N ARQ.
Computer Networks Page 2
duplicate or out-of-sequence packets. Selective Repeat ARQ maintains multiple buffers at both the sender
and receiver to store transmitted and received packets until they are successfully acknowledged.
Here's how Selective Repeat ARQ works:
1. Sender (Transmitter):
○ The sender maintains a window of sequence numbers representing the packets that can be sent.
○ It sends multiple packets within the window consecutively, similar to Go-Back-N ARQ.
○ Each packet is assigned a sequence number, and the sender waits for acknowledgments (ACKs) for
individual packets.
2. Receiver:
○ The receiver receives the packets and checks them for errors.
○ If a packet is received successfully and in sequence, the receiver sends an ACK for that specific
packet.
○ If a packet is received out of sequence or contains errors, the receiver discards the packet but does
not send an ACK.
3. Sender (Transmitter):
○ Upon receiving an ACK for a specific packet, the sender removes that packet from its buffer and
advances the window to include the next sequence number for transmission.
○ If the sender does not receive an ACK for a specific packet within a specified timeout period, it
retransmits only that packet.
4. Receiver:
○ Upon receiving a packet, the receiver checks for errors and stores the packet in its buffer if it is error -
free.
○ If the receiver receives a duplicate packet (due to retransmission), it discards the duplicate but does
not send a duplicate ACK.
Advantages of Selective Repeat ARQ:
1. Selective Retransmission: Selective Repeat ARQ allows for selective retransmission of only the lost or
damaged packets, rather than retransmitting an entire window of packets as in Go-Back-N ARQ. This
results in higher efficiency and reduced retransmission overhead.
2. Higher Throughput: By avoiding unnecessary retransmissions of correctly received packets, Selective
Repeat ARQ can achieve higher throughput compared to Go-Back-N ARQ, especially in networks with
high error rates or variable channel conditions.
3. Better Utilization of Network Resources: Selective Repeat ARQ improves the utilization of network
resources by minimizing redundant retransmissions and allowing the sender to continue transmitting
unaffected packets while retransmitting only the necessary ones.
Computer Networks Page 3
Here's how framing works in the data link layer:
1. Segmentation of Data: Before transmission, data from higher layers (such as the network layer) is segmented into smaller, manageable units called f rames. These
frames typically include a header, payload (data), and trailer.
2. Adding Frame Delimiters: Once the data is segmented into frames, frame delimiters are added to mark the beginning and end of each frame. These delimit ers serve as
flags or markers that indicate the start and end points of a frame within the data stream. Common frame delimiters include sp ecial bit sequences, such as start-of-frame
(SOF) and end-of-frame (EOF) markers.
3. Error Detection: Framing often includes mechanisms for error detection, such as cyclic redundancy check (CRC) or checksum, added to the frame' s trailer. These error
detection techniques help ensure data integrity during transmission by allowing the receiving device to detect and discard fr ames with errors.
4. Transmission: The framed data, consisting of frames with delimiters and error detection information, is transmitted over the communication medium, such as a physical
network cable or wireless connection.
5. Reception: At the receiving end, the data link layer of the receiving device identifies and extracts the frames from the incoming data s tream using the frame delimiters. It
then checks the integrity of each frame using the error detection information in the trailer.
6. Frame Processing: Once the frames are successfully received and verified, the receiving device processes the payload (data) contained within each frame. This may
involve forwarding the data to higher layers of the protocol stack for further processing or delivering it to the intended de stination.
Overall, framing in the data link layer facilitates the reliable transmission of data by segmenting it into smaller frames, a dding delimiters for frame delineation, and including
error detection mechanisms to ensure data integrity. Framing is a fundamental process in data communication protocols, enabli ng efficient and error-resilient transmission
of data over communication networks.
Bit stuffing is the process of adding one
extra 0 whenever five consecutive 1s
follow a 0 in the data, so that the
receiver does not mistake
the pattern 0111110 for a flag.
Error Detection
Computer Networks Page 4
Single-bit errors are the least likely
type of error in serial data
transmission. Burst Error: The term
burst error means that 2 or more bits
in the data unit have changed from 1
to 0 or from 0 to 1
Checksum
A checksum is a value calculated from a data packet or a block of data that is used for error detection. It is a
simple form of error detection used in various communication protocols to ensure data integrity during
transmission.
Here's how checksum works in error detection:
1. Insertion:
○ The checksum value is then appended to the data packet or included in the packet's header or
trailer, depending on the specific protocol.
○ By including the checksum with the data, the sender provides a means for the receiver to verify the
integrity of the data upon receipt.
2. Transmission:
○ The data packet, along with the checksum, is transmitted over the communication channel to the
receiver.
3. Verification:
○ Upon receiving the data packet, the receiver recalculates the checksum using the same algorithm
applied by the sender.
○ The receiver compares the recalculated checksum with the checksum received along with the data
packet.
○ If the recalculated checksum matches the received checksum, the receiver assumes that the data
packet was transmitted successfully without errors.
○ If the checksums do not match, it indicates that the data packet may have been corrupted during
transmission, and the receiver requests retransmission of the packet.
Computer Networks Page 5
Computer Networks Page 6
Multiple access protocols are used in computer networks to allow multiple devices to share a common communication medium
efficiently. Their purpose is to coordinate access to the shared channel or medium, ensuring that data transmissions from different devices do not collide and interfere
with each other.
In short, multiple access protocols serve the following purposes:
1. Coordination: They coordinate access to the shared communication medium among multiple devices to prevent collisions and ensure efficient data transmission.
2. Fairness: They provide mechanisms to allocate bandwidth fairly among competing devices, ensuring that each device gets a chance to tr ansmit data.
3. Efficiency: By managing access to the communication medium effectively, multiple access protocols help maximize the utilization of the available bandwidth and
minimize delays in data transmission.
Overall, multiple access protocols play a crucial role in enabling communication among multiple devices in a network by managing access to the shared communication
medium. Examples of multiple access protocols include CSMA/CD (Carrier Sense Multiple Access with Collision Detection) used in Ethernet networks and CSMA/CA (Carrier
Sense Multiple Access with Collision Avoidance) used in wireless networks like Wi-Fi.
Random Access Protocols
CSMA
CSMA stands for Carrier Sense Multiple Access. It is a type of multiple access protocol used in computer networks to regulate how devices access a shared communication medium,
such as a network segment or wireless channel. CSMA protocols are designed to minimize the likelihood of collisions between data transmissions from multiple devices.
There are different variants of CSMA, including:
1. 1-Persistent CSMA:
○ In 1-persistent CSMA, when a device wants to transmit data, it first listens to the communication medium.
○ If the medium is idle (no other transmission is detected), the device immediately begins transmitting its data.
○ If the medium is busy (another transmission is ongoing), the device continues to listen until the medium becomes idle. Once i dle, the device transmits its data with a
probability of 1 (i.e., it persists in trying to transmit until successful).
Example: Ethernet networks typically use 1-persistent CSMA with collision detection (CSMA/CD). When a device on an Ethernet network wants to transmit data, it first checks
if the network segment is busy. If the segment is idle, it begins transmitting immediately. If the segment is busy, it waits for a random backoff period before attempting to
transmit again.
2. 0-Persistent CSMA:
In 0-persistent CSMA, when a device wants to transmit data and finds the medium busy, it does not wait for the medium to become id le.
Computer Networks Page 7
○ In 0-persistent CSMA, when a device wants to transmit data and finds the medium busy, it does not wait for the medium to become id le.
○ Instead, it waits for a random period of time and then checks the medium again. If the medium is still busy, it repeats the p rocess until the medium becomes idle.
Example: Wi-Fi networks often use 0-persistent CSMA with collision avoidance (CSMA/CA). When a device in a Wi-Fi network wants to transmit data, it senses the wireless
channel. If the channel is busy, the device waits for a random backoff period and then senses the channel again. This process continues until the channel becomes idle, at
which point the device transmits its data.
3. p-Persistent CSMA:
○ In p-persistent CSMA, when a device wants to transmit data and finds the medium busy, it waits for a random backoff period with a probability of p.
○ If the medium is still busy after the backoff period, the device co ntinues to wait for subsequent periods until the medium b ecomes idle.
Example: Token Ring networks can use p-persistent CSMA for media access control. When a device has data to transmit, it waits for the token (a special packet) to arrive. If the
token arrives, the device grabs it and begins transmitting its data. If the token does not arrive, the device waits for a ran dom period before trying again, with a probability of p.
CSMA/CD
CSMA/CD stands for Carrier Sense Multiple Access with Collision Detection. It is a contention-based multiple access protocol used in Ethernet networks to regulate access to the
shared communication medium, such as a coaxial cable or twisted-pair cable. CSMA/CD helps to minimize the occurrence of collisions between data transmissions from multiple
devices on the network.
Here's how CSMA/CD works in depth:
1. Carrier Sense: Before transmitting data, a device listens to the communication medium to check if it is idle (no other transmissions are occ urring). If the medium is busy, the device
defers its transmission until the medium becomes idle.
2. Multiple Access: If the medium is idle, the device begins transmitting its data onto the medium. Since multiple devices share the same medium, collisions may occur if two or more
devices start transmitting simultaneously.
3. Collision Detection: While transmitting data, the device continues to monitor the medium. If the device detects that the signal it is transmitting is different from the signal it is
receiving (indicating a collision), it immediately stops transmitting and sends a jamming signal to inform other devices on t he network about the collision.
4. Backoff and Retransmission: After detecting a collision, the transmitting device enters a backoff period, during which it waits for a random amount of ti me before attempting to
retransmit its data. This random backoff period helps to reduce the likelihood of another collision when multiple devices ret ry transmission simultaneously.
5. Retransmission Attempts: The device makes a predetermined number of retransmission attempts (typically 16) using the CSMA/CD algorithm. If it is unsuc cessful after the
maximum number of attempts, it aborts the transmission and reports an error.
Example of CSMA/CD:
Consider an Ethernet network with multiple devices connected to a shared coaxial cable. When a device (Device A) wants to transmit data:
1. Device A senses the cable and detects that it is idle, so it starts transmitting its data onto the cable.
2. While Device A is transmitting, another device (Device B) simultaneously attempts to transmit data.
3. Due to the simultaneous transmission, a collision occurs on the cable, and both Device A and Device B detect the collision.
4. Device A and Device B immediately stop transmitting and send jamming signals to inform other devices about the collision.
5. Both devices enter a backoff period and wait for a random amount of time before attempting to retransmit their data.
Advantages of CSMA/CD:
1. Simple and efficient: CSMA/CD is relatively easy to implement and allows devices to share the network medium efficiently.
2. Fairness: Each device on the network has an equal opportunity to access the medium, ensuring fairness in data transmission.
Disadvantages of CSMA/CD:
1. Limited scalability: CSMA/CD becomes less efficient as network size and traffic increase due to the higher probability of col lisions.
2. Inefficiency with full-duplex Ethernet: In full-duplex Ethernet networks, where collisions do not occur, CSMA/CD overhead is unnecessary and adds complexity without providin g
benefits.
CSMA/CA (Carrier Sense Multiple Access with Collision Avoidance)
Explanation: CSMA/CA is a contention-based multiple access protocol used in wireless networks, such as Wi-Fi networks, to regulate access to the shared wireless channel. It aims
to minimize collisions between data transmissions from multiple devices by employing a collision avoidance mechanism.
1. Carrier Sense: Before transmitting data, a device senses the wireless channel to check if it is idle. If the channel is busy, the device d efers its transmission until the channel
becomes idle.
2. Multiple Access: If the channel is idle, the device sends a short request-to-send (RTS) frame to the intended receiver to request permission to transmit data. The RTS frame
includes the duration of time the transmitter expects to use the channel for its transmission.
3. Collision Avoidance: Upon receiving the RTS frame, the receiver sends a clear-to-send (CTS) frame back to the transmitter, acknowledging the request and informing other devices
to defer their transmissions for the specified duration. This process helps to reduce collisions by reserving the channel for the intended transmission.
4. Transmission: After receiving the CTS frame, the transmitter proceeds to transmit its data. Other devices that overhear the RTS and CTS frames update their network allocation
vector (NAV) timers to defer their transmissions until the current transmission is complete.
5. Acknowledgment: Upon receiving the data, the receiver sends an acknowledgment (ACK) frame to confirm successful reception. If the transmitter does not receive an ACK within a
specified time, it assumes that the transmission was unsuccessful and retries the transmission.
Example: In a Wi-Fi network, when a device (Device A) wants to transmit data:
• Device A senses the wireless channel and sends an RTS frame to the access point.
• The access point receives the RTS frame and sends a CTS frame back to Device A, reserving the channel for its transmission.
• Device A transmits its data, and other devices defer their transmissions.
• After receiving the data, the access point sends an ACK frame to Device A.
Advantages of CSMA/CA:
1. Collision Avoidance: CSMA/CA helps minimize collisions in wireless networks, improving overall network efficiency.
2. Fairness: Each device has an equal opportunity to access the wireless channel, ensuring fair data transmission.
3. Efficiency in Hidden Node Scenarios: CSMA/CA is more efficient than CSMA/CD in scenarios where devices are hidden from each other, reducing collisions caused by h idden
nodes.
Disadvantages of CSMA/CA:
1. Increased Overhead: CSMA/CA introduces additional overhead due to the exchange of RTS and CTS frames, reducing available bandwidth for data transmission.
2. Channel Utilization Inefficiency: CSMA/CA may lead to inefficient channel utilization, particularly in networks with high contention or interference, as device s must wait for
specified durations before transmitting data
Computer Networks Page 8
Ethernet
IEEE 802.3 is a set of standards that define the physical layer and data link layer specifications for Ethernet networks, whi ch are widely used local area network (LAN) technologies.
Ethernet is a family of network technologies that share common principles and protocols, but with variations in terms of data rates, media types, and other characteristics.
Features of IEEE 802.3 (Ethernet):
1. Carrier Sense Multiple Access with Collision Detection (CSMA/CD): Ethernet uses the CSMA/CD access method, which allows multiple devices to share the same transmission
medium (e.g., coaxial cable, twisted-pair cable, optical fiber) by sensing for carrier signals and deferring transmission if the medium is busy. If two devices tr ansmit simultaneously, a
collision is detected, and both devices back off and retransmit after a random delay.
2. Frame Structure: Ethernet defines a frame structure for data transmission, which includes fields for the preamble, destination and source MAC addresses, Ether-Type (identifying
the upper-layer protocol), payload data, and a frame check sequence for error detection.
3. Media Access Control (MAC) Addressing: Ethernet uses unique 48-bit MAC addresses assigned to network interface cards (NICs) for identifying devices on the network .
4. Topologies: Ethernet can support various network topologies, including bus, star, and point -to-point topologies, depending on the specific Ethernet variant and the physical media
used.
5. Auto-Negotiation: Modern Ethernet implementations support auto-negotiation, which allows devices to automatically negotiate and establish the highest common data rate and
duplex mode supported by both the device and the network.
6. Full-Duplex and Half-Duplex Modes: Ethernet can operate in full-duplex mode, where devices can transmit and receive data simultaneously, or in half -duplex mode, where devices
can either transmit or receive data, but not both at the same time.
Different Types of Ethernet:
1. Ethernet (10 Mbps): The original Ethernet standard, operating at 10 Mbps over coaxial cables or twisted -pair cables.
2. Fast Ethernet (100 Mbps): An extension of Ethernet that operates at 100 Mbps, typically using twisted-pair cables or optical fiber.
3. Gigabit Ethernet (1 Gbps): A high-speed version of Ethernet that operates at 1 Gbps, using twisted-pair cables, optical fiber, or other media types.
4. 10 Gigabit Ethernet (10 Gbps): A further extension of Ethernet that supports data rates up to 10 Gbps, primarily used in high -performance networks and data centers.
5. 40/100 Gigabit Ethernet: These are the latest and highest-speed versions of Ethernet, operating at 40 Gbps and 100 Gbps, respectively, and designed for high -bandwidth
applications like data centers and service provider networks.
6. Ethernet over Twisted Pair (EoTP): This variant of Ethernet uses twisted-pair cables, such as Category 5 (Cat5) or Cat6 cables, as the physical medium.
7. Ethernet over Coaxial Cable: This variant uses coaxial cables as the physical medium, which was common in early Ethernet implementations.
8. Ethernet over Fiber Optic Cable: This variant uses optical fiber as the physical medium, allowing for longer distances and higher data rates compared to cop per-based media.
Computer Networks Page 9
• Preamble: It is a 7 bytes starting field that provides alert and timing pulse for transmission.
• Start of Frame Delimiter: It is a 1 byte field that contains an alternating pattern of ones and zeros ending with two
ones.
• Destination Address: It is a 6 byte field containing physical address of destination stations.
• Source Address: It is a 6 byte field containing the physical address of the sending station.
• Length: It a 7 bytes field that stores the number of bytes in the data field.
• Data: This is a variable sized field carries the data from the upper layers. The maximum size of data field is 1500
bytes.
• Padding: This is added to the data to bring its length to the minimum requirement of 46 bytes.
• CRC: CRC stands for cyclic redundancy check. It contains the error detection information.
WLAN/Wi-Fi
IEEE 802.11 is a set of standards that define the specifications for wireless local area networks (WLANs), commonly known as Wi-Fi. These standards are developed and maintained
by the IEEE (Institute of Electrical and Electronics Engineers) LAN/MAN Standards Committee.
Here are the key features and aspects of IEEE 802.11:
1. Wireless Communication: IEEE 802.11 specifies the use of radio frequency (RF) signals for wireless communication between devices within a WLAN.
2. Frequency Bands: Different versions of 802.11 operate in different frequency bands, including 2.4 GHz (802.11b/g/n), 5 GHz (802.11a/n/ac/ax), and 6 GHz (802.11ax).
3. Access Methods: IEEE 802.11 defines the use of Carrier Sense Multiple Access with Collision Avoidance (CSMA/CA) as the media access control (MAC) method for wireless
communication.
4. Network Architecture: IEEE 802.11 supports two main network architectures:
○ Infrastructure mode: Wireless devices (stations) connect to a central access point (AP) that acts as a bridge to a wired network.
○ Ad-hoc mode: Wireless devices communicate directly with each other without the need for an access point.
5. Security: IEEE 802.11 specifies various security mechanisms, including Wired Equivalent Privacy (WEP), Wi-Fi Protected Access (WPA), and WPA2, which provide authentication
and encryption for wireless communication.
6. Quality of Service (QoS): IEEE 802.11e introduced QoS mechanisms to prioritize different types of traffic, such as voice, video, and data, ensuring better performance for time-
sensitive applications.
7. Power Management: IEEE 802.11 defines power management techniques to help wireless devices conserve battery life by entering low-power modes when not actively
transmitting or receiving data.
8. Roaming: IEEE 802.11 supports seamless roaming, allowing wireless devices to move between different access points while maintaining their network connection.
9. Data Rates: Different versions of IEEE 802.11 support various data rates, ranging from 1 Mbps (802.11b) to several Gbps (802.11ax), with higher data rates achieved in later
versions.
10. Backward Compatibility: Newer versions of IEEE 802.11 are designed to be backward-compatible with previous versions, allowing devices with different standards to
communicate within the same WLAN.
IEEE 802.11 standards have played a crucial role in enabling wireless networking and have significantly contributed to the widespread adoption of Wi-Fi technology.
IEEE 802.5 and Token Ring
Token Ring and IEEE 802.5 are related to a specific type of local area network (LAN) technology and standard, respectively. H ere are the important points about them in brief:
Token Ring:
• Token Ring is a LAN protocol that uses a token-passing mechanism for media access control (MAC).
• In a Token Ring network, nodes are connected in a logical ring topology.
• A small frame called a "token" is passed around the ring, and a node can transmit data only when it holds the token.
• After transmitting data, the node must release the token for other nodes to access the network.
• Token Ring provides deterministic access, ensuring that each node gets a chance to transmit data.
IEEE 802.5:
• IEEE 802.5 is the standard that defines the specifications for Token Ring networks.
• It specifies the physical layer, data link layer, and media access control (MAC) sublayer for Token Ring networks.
• The standard defines various aspects, including the frame format, token handling, ring maintenance, and error detection mecha nisms.
• IEEE 802.5 supports data rates of 4 Mbps and 16 Mbps, using shielded twisted-pair (STP) or fiber optic cabling as the physical medium.
• It includes features like priority access, early token release, and mechanisms for ring initialization and recovery.
• Piggy backing acknowledgement is used
• Unidirectional in nature
High-level Data Link Control (HDLC) is a group of communication protocols of the data link layer for transmitting data between network points or nodes. It is a bit-
oriented protocol that is applicable for both point-to-point and multipoint communications.
Features of HDLC:
• Data Organization: Since it is a data link protocol, data is organized into frames. A frame is transmitted via the network to the destination that verifies its successful arrival.
• Transfer Modes: HDLC supports two types of transfer modes, Normal Response Mode (NRM) and Asynchronous Balanced Mode (ABM). In NRM, there are two types of
stations, a primary station that sends commands and a secondary station that can respond to received commands. It is used for both point-to-point and multipoint
communications. In ABM, each station can both send commands and respond to commands. It is used for only point -to-point communications.
• HDLC Frame: Each frame contains up to six fields. The structure varies according to the type of frame. The fields of an HDLC frame are Fl ag, Address, Control, Payload, and FCS
(Frame Check Sequence).
• Types of HDLC Frames: There are three types of HDLC frames - I-frame (Information frames), S-frame (Supervisory frames), and U-frame (Un-numbered frames).
Advantages of HDLC:
• Reliability: HDLC ensures reliable data transfer, allowing one device to understand data sent by another.
• Versatility: It can operate with or without a continuous connection between devices, making it versatile for various network configuration s.
• Efficiency: It is the most widely accepted data link layer protocol. It has the advantages of flexibility, adaptability, reliability, and efficiency of operation.
• Support for Multiple Transmission Modes: Its support for multiple transmission modes, error detection and correction mechanisms, and flow control capabilities make it an
essential protocol for ensuring reliable data transmission in computer networks.
Computer Networks Page 10
Computer Networks Page 11
Unit - 3 Circuit Switching and Packet Switching
Sunday, April 21, 2024 6:14 AM
Switching Techniques
Switching techniques refer to the methods used to establish and maintain connections between devices in a communication netwo rk. There are several switching techniques,
including circuit switching, packet switching, and message switching. In this response, we will focus on circuit switching.
Circuit Switching Technique:
Circuit switching is a switching technique that establishes a dedicated end -to-end physical or logical connection between the source and destination devices before any data
transmission occurs. This connection, known as a circuit, remains dedicated for the entire duration of the communication sess ion, ensuring exclusive use of the allocated resources.
How Circuit Switching Works:
1. Circuit Establishment: Before data transmission can occur, a circuit must be established between the source and destination devices. This process in volves signaling protocols that
reserve the necessary resources (e.g., bandwidth, switches, and links) along the path.
2. Data Transfer: Once the circuit is established, the entire bandwidth of the circuit is dedicated solely to the communication between the sou rce and destination devices.
3. Circuit Teardown: After the data transfer is complete, the circuit is torn down, and the reserved resources are released for use by other conne ctions.
Examples of Circuit Switching:
1. Traditional Telephone Networks: The public switched telephone network (PSTN) is a classic example of circuit switching, where dedicated circuits are establis hed between the
calling and called parties for the duration of a voice call.
2. Integrated Services Digital Network (ISDN): ISDN is a circuit-switched digital network that provides end-to-end digital connectivity for a wide range of services, including voice,
data, and video.
Advantages of Circuit Switching:
1. Guaranteed Bandwidth: Circuit switching ensures that the full bandwidth of the circuit is dedicated to the communication session, providing a guara nteed and constant data rate.
2. Low Latency: With a dedicated circuit, there is minimal delay or latency in data transmission, making circuit switching suitable for real -time applications like voice and video calls.
3. Privacy and Security: Circuit switching provides a high level of privacy and security since the circuit is dedicated and not shared with other user s during the communication
session.
4. No Packet Overhead: In circuit switching, there is no need for packet headers or other overhead information, as data is transmitted over the dedi cated circuit.
Disadvantages of Circuit Switching:
1. Inefficient Resource Utilization: Circuit switching can lead to inefficient resource utilization, as the entire circuit is dedicated to a single communication session, even during
periods of inactivity or low data transfer.
2. Inflexibility: Circuit switching is less flexible than packet switching, as it requires dedicated circuits for each communication session, m aking it more challenging to adapt to varying
bandwidth requirements or dynamic traffic patterns.
3. Limited Scalability: Circuit switching can be challenging to scale, as the number of circuits and associated resources (e.g., switches, links) mus t be increased to accommodate more
users or higher bandwidth requirements.
Computer Networks Page 1
Space Division Switches
• Space Division Switching is a circuit switching technology in which a single transmission path is accomplished in a
switch by using a physically separate set of crosspoints.
• Space Division Switching can be achieved by using crossbar switch. A crossbar switch is a metallic crosspoint or
semiconductor gate that can be enabled or disabled by a control unit.
• The Crossbar switch is made by using the semiconductor. For example, Xilinx crossbar switch using FPGAs.
• Space Division Switching has high speed, high capacity, and nonblocking switches.
Space Division Switches can be categorized in two ways:
• Crossbar Switch
• Multistage Switch
Crossbar Switch
The Crossbar switch is a switch that has n input lines and n output lines. The crossbar switch has n2 intersection points
known as crosspoints.
Disadvantage of Crossbar switch:
The number of crosspoints increases as the number of stations is increased. Therefore, it becomes very expensive for
a large switch. The solution to this is to use a multistage switch.
Multistage Switch
• Multistage Switch is made by splitting the crossbar switch into the smaller units and then interconnecting them.
• It reduces the number of crosspoints.
• If one path fails, then there will be an availability of another path.
Time Division Switching (TDS)
Time Division Switching (TDS) is a switching technique used in telecommunications networks and computer networks
to establish and maintain connections between communication endpoints. Unlike space division switching, which
uses dedicated physical paths, TDS shares a single physical path among multiple connections by dividing the available
transmission time into time slots.
How Time Division Switching Works:
1. Time Slot Assignment: In TDS, the available transmission time on a communication link or channel is divided into
fixed-length time slots. Each time slot represents a specific portion of the total bandwidth or transmission
capacity.
2. Time Slot Interchanging (TSI): Time Slot Interchanging (TSI) is the core principle behind TDS. At each switching
node or time division switch, incoming time slots from various input links are reorganized and mapped to
outgoing time slots on the appropriate output links.
3. Time Slot Interchange (TSI) Switch: The TSI switch is the key component in TDS networks. It is responsible for
switching and interchanging time slots between input and output links. The TSI switch consists of a matrix of
cross-points that can connect any input time slot to any output time slot.
4. Connection Establishment: To establish a connection between two endpoints, the TSI switch allocates a time slot
on the input link from the source and another time slot on the output link towards the destination. The TSI switch
then maps or interchanges the input time slot to the corresponding output time slot for the duration of the
connection.
5. Multiplexing and Demultiplexing: At the transmitting and receiving ends, multiplexers and demultiplexers are
used to combine multiple data streams into a single time-division multiplexed (TDM) signal and separate the
individual data streams from the TDM signal, respectively.
Features of Time Division Switching:
1. Efficient Bandwidth Utilization: TDS enables efficient utilization of transmission bandwidth by sharing a single
physical link among multiple connections through time slot allocation.
2. Simultaneous Connections: TDS allows multiple connections to be established and maintained simultaneously by
interchanging time slots at the switching nodes.
3. Circuit-like Behavior: Although TDS uses a shared physical link, it provides a circuit-like behavior for each
connection, ensuring reliable and ordered data delivery.
4. Scalability: TDS networks can be scaled by adding more time slots or increasing the transmission rate, allowing for
the accommodation of more connections or higher bandwidth requirements.
5. Compatibility with TDM: TDS is compatible with time-division multiplexing (TDM) techniques, making it suitable
for integrating various types of traffic, such as voice, data, and video, onto a single transmission medium.
Message Switching
Message switching is a switching technique used in computer networks and telecommunication systems for transmitting data mess ages between communication endpoints.
Unlike circuit switching and packet switching, message switching operates at a higher level of abstraction, treating the enti re message as a single unit.
Features of Message Switching:
1. Store-and-Forward Mechanism: In message switching, messages are first stored at each intermediate node (switch or router) before being forwarded to the ne xt node
along the path towards the destination. This store-and-forward mechanism allows for the temporary storage of messages, enabling reliable delivery and efficient use of
network resources.
2. Message-Level Switching: Message switching operates at the message level, treating each message as a single entity rather than dividing it into smalle r units (like
packets). The entire message is stored, forwarded, and delivered as a whole.
3. Message Queuing: At each intermediate node, incoming messages are queued and processed in a specific order, typically first -in-first-out (FIFO). This queuing mechanism
helps manage message flow and prevent congestion or overload.
4. Message Prioritization: Some message switching systems support message prioritization, allowing higher -priority messages to be processed and delivered before lower-
priority messages. This feature is useful in scenarios where certain messages require preferential treatment or faster delivery.
5. Message Security: Message switching systems often include security mechanisms, such as encryption and authentication, to protect the confidenti ality and integrity of
messages during transmission and storage.
Examples of Message Switching:
Email Systems: Email systems are a common example of message switching, where email messages are stored, forwarded, and delivered across m ultiple mail servers
before reaching their final destination.
Computer Networks Page 2
before reaching their final destination.
Advantages of Message Switching –
Message switching has the following advantages:
1. As message switching is able to store the message for which communication channel is not available, it helps in reducing the traffic congestion in the network.
2. It makes traffic management efficient by assigning priorities to the messages.
3. Because the messages are delivered via a store and forward method, it is possible to include priority in them.
4. It allows for infinite message lengths.
Disadvantages of Message Switching –
Message switching has the following disadvantages:
1. Message switching cannot be used for real-time applications as storing messages causes delay.
2. In message switching, the message has to be stored for which every intermediate device in the network requires a large storin g capacity.
While message switching was widely used in the early days of computer networking, its usage has declined with the advent of m odern packet-switched networks and the
dominance of the Internet Protocol (IP). However, message switching principles and techniques are still relevant in certain a pplications, such as email systems and specialized
communication networks, where message-level handling and store-and-forward mechanisms are beneficial.
Packet Switching
Packet switching is a data transmission technique used in modern computer networks and telecommunication systems. In packet switching, data is divided into smaller units called
packets, which are then transmitted independently over the network and reassembled at the destination.
Features of Packet Switching:
1. Datagram Approach: In packet switching, data is divided into small, independent units called datagrams or packets. Each packet contains a header with source and destination
addresses, as well as other control information.
2. Dynamic Routing: Packets are dynamically routed through the network based on the destination address and the current network conditions. Routers determine the best path
for each packet based on routing protocols and algorithms.
3. Statistical Multiplexing: Packet switching allows multiple data streams or sessions to share the same communication channel or link simultaneously. The available bandwidth is
dynamically allocated based on the traffic demands of each session, resulting in efficient utilization of network resources.
4. Packet Switching Nodes: Packet switching networks consist of specialized nodes called routers or switches, which are responsible for forwarding packets towards their
destinations based on routing tables and algorithms.
5. Store-and-Forward Mechanism: At each intermediate node (router or switch), packets are received, temporarily stored in buffers, and then forwarded towards the next hop on
the path to the destination. This store-and-forward mechanism allows for error checking, congestion control, and traffic management.
6. Error Detection and Recovery: Packet switching protocols include mechanisms for error detection and recovery, such as checksums and sequence numbers. If errors are
detected or packets are lost during transmission, retransmission techniques can be employed to ensure reliable data delivery.
7. Connectionless and Connection-Oriented Modes: Packet switching can operate in connectionless mode (e.g., UDP) or connection-oriented mode (e.g., TCP). In connectionless
mode, packets are transmitted independently without establishing a dedicated connection, while in connection-oriented mode, a virtual circuit or logical connection is
established before data transmission begins.
Advantages of Packet Switching over Circuit Switching and Message Switching:
1. Efficient Resource Utilization: Packet switching allows for the efficient sharing of network resources among multiple data streams, resulting in better resource utilization
compared to dedicated circuits in circuit switching.
2. Flexibility and Scalability: Packet switching networks are more flexible and scalable than circuit-switched or message-switched networks. They can adapt to changing traffic
patterns and accommodate a large number of users and applications.
3. Robustness and Resilience: Packet switching networks are highly robust and resilient due to dynamic routing and the ability to reroute packets around failed or congested links.
4. Support for Diverse Applications: Packet switching can accommodate a wide range of applications with varying bandwidth and quality of service (QoS) requirements, from real-
time multimedia to file transfers.
5. Global Reach: Packet switching is the foundation of the Internet and other modern data networks, enabling global connectivity and seamless communication across diverse
networks and technologies.
Packet switching can be further categorized into two main approaches: virtual circuit packet switching and datagram packet switching. Each approach has its own advantages and
Computer Networks Page 3
Packet switching can be further categorized into two main approaches: virtual circuit packet switching and datagram packet switching. Each approach has its own advantages and
disadvantages, which are discussed below:
Virtual Circuit Packet Switching
Virtual circuit packet switching is a connection-oriented approach where a logical path or virtual circuit is established between the source and destination before data transmission
begins. This virtual circuit is maintained for the duration of the communication session.
Advantages of Virtual Circuit Packet Switching:
1. Guaranteed Quality of Service (QoS): Virtual circuits can provide guaranteed QoS by reserving network resources (bandwidth, buffers, etc.) along the path, ensuring
predictable performance for delay-sensitive applications like voice and video.
2. Ordered Delivery: Packets belonging to the same virtual circuit are delivered in the same order they were sent, as they follow the same path through the network.
3. Flow Control and Error Control: Virtual circuits can implement flow control and error control mechanisms to prevent data loss and ensure reliable delivery.
4. Efficient for Long-Lived Connections: Virtual circuits are efficient for long-lived connections or sessions, as the overhead of establishing the virtual circuit is incurred only once.
Disadvantages of Virtual Circuit Packet Switching:
1. Setup Delay: Establishing a virtual circuit introduces a setup delay before data transmission can begin, which may not be suitable for delay-sensitive applications.
2. Inefficient for Short-Lived Connections: For short-lived connections, the overhead of setting up and tearing down virtual circuits can outweigh the benefits.
3. Complexity: Virtual circuit packet switching requires more complex protocols and state management in network devices to establish, maintain, and tear down virtual circuits.
4. Resource Reservation: Reserving network resources for virtual circuits can lead to inefficient resource utilization if the reserved capacity is not fully utilized.
Datagram Packet Switching
Datagram packet switching is a connectionless approach where each packet is treated independently and routed based on the destination address information contained within the
packet header. No prior setup or virtual circuit is established.
Advantages of Datagram Packet Switching:
1. Simplicity: Datagram packet switching is simpler and requires less overhead than virtual circuit switching, as there is no need for connection setup or teardown.
2. Robustness: Packets can be dynamically routed around failed or congested links, providing robustness and resilience.
3. Flexibility: Datagram packet switching is flexible and can adapt to changing network conditions and traffic patterns.
Disadvantages of Datagram Packet Switching:
1. No Guaranteed QoS: There is no guaranteed Quality of Service (QoS) or reserved resources for individual data streams or connections.
2. Possible Out-of-Order Delivery: Packets may be delivered out of order, as they can take different paths through the network.
3. No Built-in Flow Control or Error Control: Datagram packet switching does not inherently provide flow control or error control mechanisms, requiring these to be implemented
at higher layers (e.g., TCP).
4. Inefficient for Long-Lived Connections: For long-lived connections or sessions, the lack of state information in datagram packet switching can lead to inefficiencies, as each
packet must carry the full source and destination addresses.
Both virtual circuit packet switching and datagram packet switching have their strengths and weaknesses, and the choice between them depends on the specific requirements of
the applications and network environment. In practice, many modern networks, such as the Internet, employ a combination of both approaches, with connectionless datagram
packet switching (e.g., IP) at the network layer and connection-oriented virtual circuits (e.g., TCP) at the transport layer.
How packet size affects the transmission time in a packet switching network?
In packet switching networks, the size of the packet can significantly impact the transmission time, which is the total time required for a packet to travel from the source to the
destination. There are several factors that contribute to the transmission time, and the packet size plays a crucial role in determining these factors.
1. Transmission Delay: The transmission delay is the time required to transmit the entire packet onto the communication link or channel. This delay is directly proportional to the
packet size and inversely proportional to the link's data rate or bandwidth. Transmission Delay = Packet Size / Link Bandwidth Larger packets require more time to be
transmitted onto the link, resulting in a higher transmission delay compared to smaller packets on the same link.
2. Propagation Delay: The propagation delay is the time it takes for the packet to travel through the physical medium (e.g., copper wire, optical fiber) from the source to the
destination. This delay is determined by the distance between the source and destination, as well as the propagation speed of the medium. Propagation Delay = Distance /
Propagation Speed The packet size does not directly affect the propagation delay, as the entire packet traverses the medium at the propagation speed, regardless of its size.
3. Processing Delay: The processing delay is the time required by network devices (routers, switches) to perform various operations on the packet, such as error checking, routing
table lookup, and forwarding decisions. This delay can be influenced by the packet size, as larger packets may require more processing time compared to smaller packets.
4. Queuing Delay: The queuing delay occurs when packets arrive at a network device faster than the device can process or transmit them, causing them to be temporarily stored
in queues or buffers. Larger packets generally require more time to be transmitted, which can lead to increased queuing delays, especially in congested networks.
The overall transmission time for a packet is the sum of the transmission delay, propagation delay, processing delay, and queuing delay.
Transmission Time = Transmission Delay + Propagation Delay + Processing Delay + Queuing Delay
In general, smaller packets tend to have shorter transmission times compared to larger packets, as they require less time to be transmitted onto the link and less processing time at
network devices. However, it's important to note that while smaller packets may have lower individual transmission times, they also introduce more overhead due to the additional
packet headers required for each packet.
Network designers and protocols often strike a balance between packet size and overhead by selecting an appropriate Maximum Transmission Unit (MTU) size, which represents
the maximum packet size that can be transmitted without fragmentation. The optimal packet size depends on various factors, including the network topology, link characteristics,
and application requirements.
Computer Networks Page 4
Computer Networks Page 5
Unit - 4: Routing and Network layer
Friday, April 19, 2024 5:29 PM
What is Routing
1. What is Routing in Network Layer?
Routing is a process that occurs in the network layer (Layer 3) of the OSI (Open Systems Interconnection) model. The main function of routing is to determine the optimal path for data
packets to travel from the source to the destination across an internetwork. This involves routers, which are devices that fo rward data packets along this network path.
2. Benefits of Routing:
• Efficient Data Delivery: Routing ensures that data is efficiently delivered across the network by selecting the most optimal path based on factors such as network congestion, number
of hops, and link cost.
• Scalability: Routing protocols can handle large and complex networks, making it possible to connect thousands of devices seamlessly.
• Fault Isolation: If a problem occurs in one network, routing can prevent the issue from spreading to other networks.
3. Challenges of Routing:
• Complexity: Implementing and managing routing protocols can be complex, especially in large networks. It requires a deep understanding of network topologies and routing
algorithms.
• Security: Routers can be targets for malicious activities. Unauthorized access or attacks on a router can disrupt network connectivity.
• Performance: The process of determining the best path and forwarding packets can consume significant resources, potentially affecting network performance.
Routing and Flooding
1. Definition:
• Routing: It is a process that occurs in the network layer (Layer 3) of the OSI model. The main function of routing is to determine the optimal path for data packets to travel from the
source to the destination across an internetwork.
• Flooding: It is a simple routing algorithm in which every incoming packet is sent through every outgoing link except the one it arrived on. It is used in bridging and in systems such as
Usenet and peer-to-peer file sharing and as part of some routing protocols.
2. Efficiency:
• Routing: It is more efficient as it determines the optimal path for data packets to travel from the source to the destination. It redu ces network congestion and ensures efficient data
delivery.
• Flooding: It is less efficient as it sends every incoming packet through every outgoing link, which can lead to high network traffic an d congestion.
3. Resource Usage:
• Routing: It uses resources efficiently by choosing the best path for data transmission. This reduces unnecessary network traffic.
• Flooding: It uses more resources as it involves sending packets through every possible route in the network. This can lead to redundanc y and high network traffic.
4. Complexity:
• Routing: It is more complex as it involves the use of routing algorithms and protocols to determine the best path for data transmission (less reliable).
• Flooding: It is less complex as it does not require any path-finding algorithms. It simply sends packets to all outgoing links (more reliable).
5. Use Cases:
• Routing: It is used in most networking scenarios where data needs to be transmitted from one point to another in the most efficient wa y possible.
• Flooding: It is used in specific scenarios such as in the distribution of information to all nodes in a network, in some routing protoc ols, and in systems like Usenet and peer-to-peer file
sharing.
6. Duplicate data:
• Routing: It doesn’t generate large number of duplicate data packets.
• Flooding: It tends to generate a large number of duplicate data packets.
Static Routing and Dynamic Routing:
1. Definition:
• Static Routing: It is a type of network routing technique. Network administrators manually configure static routes, which remain constant u nless changed manually.
• Dynamic Routing: It is another type of network routing technique. In dynamic routing, routers automatically calculate routes based on the cu rrent topology of the network, which
can change dynamically.
2. Configuration:
• Static Routing: Requires manual configuration and management. The network administrator must update the routing table manually each time there is a change in the network
topology.
• Dynamic Routing: Automatically adjusts to network changes. Routing protocols are used to update routing tables automatically whenever there is a change in the network topology.
3. Resource Usage:
• Static Routing: Uses fewer network resources since routes are not automatically updated. However, it can be labor-intensive to manage in large networks.
• Dynamic Routing: Uses more network resources because routing updates are sent periodically or when network changes occur. However, it reduce s the administrative overhead in
large networks.
4. Scalability:
• Static Routing: Works well in small networks where network paths rarely change but does not scale well in large networks.
• Dynamic Routing: Scales well with the size of the network and can accommodate network growth and frequent path changes.
5. Control and Security:
• Static Routing: Provides more control over routing paths and can be more secure since administrators explicitly define routes.
• Dynamic Routing: Provides less control over routing paths, but modern routing protocols include features to enhance security.
Router Classification:
1. Static versus Adaptive:
- Static Routers: Static routers rely on manually configured routing tables. The network administrator manually defines the routes, specifying t he destination networks and the
interfaces or next-hop routers to reach them. Static routing is suitable for small networks with relatively unchanging topologies.
- Adaptive Routers: Adaptive routers dynamically learn and update their routing tables based on routing protocols. These routers exchange routing information with other routers,
adapting to network changes and automatically updating their routing tables. Adaptive routing is preferred for larger and mor e dynamic networks.
2. Single-path versus Multi-path:
- Single-path Routing: In single-path routing, routers maintain only one path (the best path) to each destination network in their routing tables. If the prim ary path fails, the router must
recompute an alternative path.
- Multi-path Routing: Multi-path routing allows routers to maintain multiple paths to the same destination network. The router can distribute traffic acr oss these multiple paths,
providing load balancing and redundancy.
3. Intra-domain versus Inter-domain:
Computer Networks Page 1
3. Intra-domain versus Inter-domain:
- Intra-domain Routing: Intra-domain routing protocols are used within a single autonomous system (AS) or domain, such as a single organization's network. Examples include Open
Shortest Path First (OSPF) and Enhanced Interior Gateway Routing Protocol (EIGRP).
- Inter-domain Routing: Inter-domain routing protocols are used to exchange routing information between different autonomous systems or domains, enabling c ommunication across
the internet. The Border Gateway Protocol (BGP) is the primary inter-domain routing protocol used for routing between different networks or service providers.
4. Flat versus Hierarchical:
- Flat Routing: In flat routing, all routers within a network have a complete view of the entire network topology and maintain routing inform ation for all destinations. This approach
becomes impractical and inefficient as networks grow larger.
- Hierarchical Routing: Hierarchical routing divides a large network into smaller, more manageable hierarchical levels or areas. Routers within an ar ea maintain detailed routing
information for their area and summarized information about other areas, reducing routing table sizes and overhead.
5. Link-state versus Distance Vector:
- Link-state Routing: Link-state routing protocols, such as OSPF, maintain a complete map of the network topology by sharing link-state advertisements (LSAs) with neighboring routers.
Each router constructs a complete topological map of the network and calculates the shortest paths using algorithms like Dijk stra's algorithm.
- Distance Vector Routing: Distance vector routing protocols, like Routing Information Protocol (RIP), rely on routers exchanging distance vectors (dest ination networks and their
associated metrics or distances) with neighbors. Routers update their routing tables based on the received distance vectors, choosing the shortest paths using iterative calculations.
6. Host-intelligent versus Router-intelligent:
- Host-intelligent Routing: In host-intelligent routing, the end hosts (computers or servers) determine the optimal paths and make routing decisions. The hosts m aintain routing tables
and communicate directly with each other to establish connections.
- Router-intelligent Routing: Router-intelligent routing places the responsibility of routing decisions on the network routers. Routers maintain routing tables an d forward packets based
on their routing protocols and algorithms, without the involvement of end hosts in routing decisions.
Please note that these categories are not mutually exclusive, and a router can exhibit characteristics from multiple categori es. For example, a router can be adaptive and support both
single-path and multi-path routing, or it can be hierarchical and use link-state routing protocols within its domain while using distance vector protocols for inter-domain routing.
Router algorithms metrics
1. Path Length:
○ Path length refers to the number of routers or hops a packet must traverse to reach its destination.
○ Routing algorithms often aim to find the shortest path, minimizing the number of hops, as each hop introduces latency and potential points of failure.
○ Shorter paths are generally preferred for their lower overhead and reduced propagation delay.
2. Delay:
○ Delay represents the time it takes for a packet to travel from the source to the destination.
○ Routing algorithms may consider different types of delay, such as propagation delay (based on link speed and distance), processing delay (time spent in router queues), and
queuing delay (time spent waiting in router buffers).
○ Minimizing delay is crucial for time-sensitive applications, such as voice over IP (VoIP) and video conferencing.
3. Bandwidth:
○ Bandwidth refers to the maximum data transfer rate or capacity of a network link.
○ Routing algorithms may consider bandwidth as a metric to find paths with sufficient capacity to handle the expected traffic load.
○ High-bandwidth paths are preferred for applications that require large amounts of data transfer, such as file transfers or streaming media.
4. Load:
○ Load represents the current traffic volume or utilization on a network link or router.
○ Routing algorithms may consider load as a metric to balance traffic across multiple paths and avoid congested links or routers.
○ Load balancing can improve network performance and prevent bottlenecks by distributing traffic more evenly across the available resources.
5. Communication Cost:
○ Communication cost refers to the monetary or resource cost associated with using a particular network link or path.
○ Routing algorithms may consider communication costs when choosing paths, especially in scenarios where different service providers or network providers are involved.
○ Cost metrics can be used to optimize routing decisions based on financial considerations or resource constraints.
6. Reliability:
○ Reliability represents the likelihood of a network link or path remaining operational and delivering data successfully.
○ Routing algorithms may consider reliability metrics, such as link or node failure rates, to find paths that are more stable and less prone to disruptions.
○ High reliability is essential for mission-critical applications or networks that require high availability and minimal downtime.
Routing protocols and their types
Routing protocols are a set of rules used by routers to determine the most appropriate paths into which they should forward packets towards the ir intended destinations. These
protocols facilitate the exchange of routing information between routers, enabling them to build routing tables that guide pa cket delivery.
There are three main types of routing protocols:
1. Distance Vector Routing Protocols:
Distance Vector protocols use metrics to determine the best path for data transmission based on the distance to the destinati on. They work by sharing their routing table with their
immediate neighbors. An example of a Distance Vector protocol is the Routing Information Protocol (RIP).
2. Link State Routing Protocols:
Link State protocols have a complete picture of the network topology. Each router independently maps the network’s structure and then determines the best path from it. This results in
a more accurate and reliable network, but at the cost of more CPU usage and memory. An example of a Link State protocol is th e Open Shortest Path First (OSPF).
3. Hybrid/Advanced Distance Vector Protocols:
Hybrid protocols combine aspects of both Distance Vector and Link State protocols. They use metrics to determine the best pat h like Distance Vector protocols, but they also incorporate
state information like Link State protocols. This results in a more efficient and scalable network. An example of a Hybrid pr otocol is the Enhanced Interior Gateway Routing Protocol
(EIGRP).
Autonomous Systems (AS):
An Autonomous System (AS) is a collection of networks and routers under a single administrative domain that uses an interior gateway protocol (IGP) like RIP, OSPF, or IS-IS to share
routing information and determine optimal paths within the AS. Each AS is assigned a unique ASN (Autonomous System Number) fo r identification purposes.
The primary functions of an AS are:
1. To present a consistent routing view to the outside world for traffic destined for its internal networks.
2. To control the routing information exchange within the AS and with other ASes.
Computer Networks Page 2
2. To control the routing information exchange within the AS and with other ASes.
ASes are typically owned and operated by Internet Service Providers (ISPs), large organizations, or universities. They can be interconnected with one another to form the global Internet.
Distance Vector Routing (DVR) Algorithm: The Distance Vector Routing (DVR) protocol, also known as the Bellman-Ford algorithm, is a routing protocol that requires a
router to inform its neighbors of topology changes periodically. Each router maintains a Distance Vector table containing the distance between itself and all possible destination
nodes. Distances are computed based on a chosen metric, using information from the neighbors’ distance vectors.
Working Mechanism:
• Each router has an ID.
• Associated with each link connected to a router, there is a link cost (static or dynamic).
• Each router maintains a distance vector table. The distance to itself is 0, and the distance to all other routers is initially set to infinity.
• A router transmits its distance vector to each of its neighbors in a routing packet.
• Each router receives and saves the most recently received distance vector from each of its neighbors.
• A router recalculates its distance vector when it receives a distance vector from a neighbor containing different information than before, or it discovers that a link to a neighbor
has gone down.
• The distance vector calculation is based on minimizing the cost to each destination.
Advantages of Distance Vector Routing:
• Simplicity: It is simpler to configure and maintain than link state routing.
• Ideal for Small Networks: Due to its straightforward nature, it is ideal for small networks where complexity is not required.
Disadvantages of Distance Vector Routing:
• Slow Convergence: It is slower to converge than link state routing.
• Count-to-Infinity Problem: It is at risk from the count-to-infinity problem.
• More Traffic: It creates more traffic than link state since a hop count change must be propagated to all routers and processed on each router.
• Bandwidth-Wasting Broadcasts: Hop count updates take place on a periodic basis, even if there are no changes in the network topology, so bandwidth-wasting broadcasts still
occur.
• Larger Routing Tables: For larger networks, distance vector routing results in larger routing tables than link state since each router must know about all other routers.
Computer Networks Page 3
Routing Information Protocol (RIP)
RIP (Routing Information Protocol) is a distance-vector routing protocol used for routing data packets between routers on an internal network or an Autonomous System (AS). It is one of the
oldest routing protocols and is still widely used, although it is generally considered outdated and has been superseded by more advanced protocols like OSPF (Open Shortest Path First) and
IS-IS (Intermediate System to Intermediate System).
Features of RIP:
1. Distance-Vector Protocol: RIP is a distance-vector routing protocol, which means that it uses the distance (number of hops) and vector (direction) to determine the best path to a
destination network.
2. Hop Count Metric: RIP uses hop count as the metric for measuring the distance to a destination network. The maximum number of hops allowed in RIP is 15, which effectively limits the
network diameter to 15 routers.
3. Periodic Updates: RIP routers periodically exchange their routing tables with their neighbors every 30 seconds to maintain up-to-date information about the network topology.
4. Split Horizon: RIP employs the split horizon technique to prevent routing loops by ensuring that a router does not advertise a route back tothe interface from which it learned that
route.
5. Poison Reverse: RIP uses the poison reverse technique to prevent routing loops by advertising a route with an infinite metric (16 hops) back to the router from which it learned that
route.
6. Triggered Updates: RIP routers send triggered updates when there is a change in the network topology, instead of waiting for the next periodic update, to propagate the changes more
quickly.
7. Bellman-Ford Algorithm: RIP uses the Bellman-Ford algorithm to calculate the shortest path to each destination network.
Steps of RIP Algorithm (Bellman-Ford Algorithm):
1. Each router calculates the distances to all other routers within the AS and stores this information in a routing table.
2. Each router sends its routing table to all its neighboring routers.
3. When a router receives routing tables from its neighbors, it calculates the shortest routes to all other routers and updates its own routing table accordingly.
4. This process is repeated periodically, and the routing tables are updated to reflect any changes in the network topology.
RIP Versions:
1. RIP Version 1 (RIPv1): This is the original version of RIP, which was defined in RFC 1058. It has several limitations, such as:
○ It supports only classful IP addressing (no support for CIDR or VLSM).
○ It does not support authentication, making it vulnerable to security threats.
○ It uses broadcasting to send updates, which can cause excessive overhead on large networks.
2. RIP Version 2 (RIPv2): RIPv2, defined in RFC 2453, addresses some of the limitations of RIPv1:
○ It supports classless IP addressing (CIDR and VLSM).
○ It provides authentication mechanisms to enhance security.
○ It uses multicasting instead of broadcasting to reduce overhead on non -RIP hosts.
○ It includes a subnet mask field and a next-hop field in the routing updates.
Although RIP is simple and easy to configure, it has several drawbacks, such as slow convergence (due to the Count-to-Infinity problem), limited network diameter, and lack of support for
advanced features like load balancing and unequal-cost load sharing. These limitations have led to the development of more advanced routing protocols like OSPF and IS-IS for modern
networks.
RIP uses three different timers to regulate its performance and maintain accurate routing information
1. Routing Update Timer:
○ This timer controls the periodic interval at which a router sends its complete routing table to all neighboring routers.
○ The default value for the routing update timer is 30 seconds.
○ A small random value is added to the timer whenever it is reset to prevent synchronization issues, where all routers send upd ates simultaneously, potentially causing congestion.
2. Route Invalid Timer (Route Timeout Timer):
○ This timer determines the maximum time a route can remain in the routing table without receiving an update for that route.
○ If no update is received for a particular route within the route invalid timer interval, the route is marked as invalid.
○ The default value for the route invalid timer is typically 180 seconds (3 minutes).
3. Route Flush Timer:
○ This timer determines the maximum time a route can remain in the routing table after being marked as invalid.
○ If no update is received for an invalid route within the route flush timer interval, the route is removed (flushed) from the routing table.
○ The default value for the route flush timer is typically 240 seconds (4 minutes).
The timers work together in the following manner:
1. The routing update timer ensures that a router sends its complete routing table to its neighbors every 30 seconds, allowing for periodic updates and maintaining consistent routing
information across the network.
2. If a router does not receive an update for a particular route within the route invalid timer interval (180 seconds), it marksthat route as invalid.
3. However, the router does not immediately remove the invalid route from its routing table. Instead, it waits for the route flush timer interval (240 seconds) to expire.
4. If no update is received for the invalid route within the route flush timer interval, the route is removed from the routing table.
The use of these timers helps RIP maintain accurate routing information while also providing a grace period for routes to be updated before being removed from the routing table. This
mechanism helps prevent routing loops and ensures that routing information converges correctly after network topology changes.
Solutions to the Slow Convergence Problem in RIP:
The slow convergence problem, also known as the "Count-to-Infinity" problem, is a significant issue in distance-vector routing protocols like RIP. It occurs when a router advertises a route as
valid even after the path to the destination has become invalid, leading to routing loops and increased convergence time. Several techniques have been introduced to mitigate this problem
in RIP:
1. Hold-Down Timers: When a router detects that a route has become invalid, it sets a hold-down timer for that route. During this hold-down period, the router ignores any new
information about that route, giving the network time to converge before accepting new routes. This prevents the count-to-infinity problem by not immediately accepting potentially
invalid routes.
2. Split Horizon: Split horizon is a technique that prevents a router from advertising a route back on the interface from which it learned thatroute. This helps prevent routing loops by not
sending routing information in the direction it was received.
3. Poison Reverse: In poison reverse, when a router detects that a route has become invalid, it advertises that route with an infinite metric (16 hops in RIP) to its neighbors. This "poisons"
the route and forces the neighbors to remove that entry from their routing tables, accelerating convergence.
4. Triggered Updates: In standard RIP, routing updates are sent periodically (every 30 seconds). With triggered updates, a router sends an immediate update as soon as it detects a change
in the network topology, rather than waiting for the next periodic update. This helps propagate routing changes more quickly throughout the network.
5. Route Aggregation: Route aggregation combines multiple routes into a single advertisement, reducing the size of routing tables and the number ofupdates required. This can improve
convergence time in large networks by reducing the amount of routing information that needs to be processed and propagated.
While these techniques help mitigate the slow convergence problem, they do not completely eliminate it. RIP's reliance on hopcount as the sole metric and its limited network diameter
(maximum of 15 hops) make it less suitable for large and complex networks.
Computer Networks Page 4
Link State Routing (LSR) Algorithm: The Link State Routing (LSR) protocol is a routing protocol where each router maintains a database of the network’s topology. When a
router’s state changes, it sends a message to all other routers, informing them of the change. This allows each router to hav e a complete picture of the network and calculate the best
path to each destination.
Working Mechanism:
• Each router knows the cost of its directly connected links.
• When a router’s state changes, it creates a packet known as a Link State Advertisement (LSA) that contains the state of each of its links.
• This LSA is then flooded to all routers in the network.
• Each router, upon receiving the LSA, updates its database and then forwards the LSA to all neighboring routers.
• Once a router’s database is updated, it uses Dijkstra’s algorithm to calculate the shortest path to each network.
Advantages of Link State Routing:
• Fast Convergence: LSR converges quickly, and adapts to changes in the network more quickly.
• Accurate and Comprehensive Information: Each router has a complete and synchronized picture of the network.
• Efficient Routing Decisions: Routers use the latest information to make the best routing decisions 2.
• Support for CIDR and VLSM: Link-state protocols support Classless Inter-Domain Routing (CIDR) and Variable Length Subnet Masking (VLSM).
Disadvantages of Link State Routing:
• Resource Intensive: They require more memory and processor power than distance vector protocols 2.
• Complexity: They require strict hierarchical network design, so that a network can be broken into smaller areas to reduce the size of the topology tables2.
• Initial Overhead: They flood the network with LSAs during the initial discovery process 2.
• Expertise Required: They require an administrator who understands the protocols well 2.
OSPF (Open Shortest Path First)
OSPF (Open Shortest Path First) is a link-state routing protocol designed for routing data packets within an Autonomous System (AS) or a group of networks under a sing le
administrative domain. It is an Interior Gateway Protocol (IGP) that uses the Shortest Path First (SPF) algorithm, also known as the Dijkstra algorithm, to calculate the shortest paths
between routers.
Features of OSPF:
1. Open Standard: OSPF is an open standard protocol, and its specifications are publicly available, allowing anyone to implement it without pay ing license fees.
2. Link-State Routing: OSPF is a link-state routing protocol, which means that each router maintains a complete topological database of the network, including info rmation about
connected interfaces, metrics, and other variables.
3. Hierarchical Network Design: OSPF allows for a hierarchical network design by dividing an AS into smaller areas, reducing routing overhead and improving s calability.
4. Authentication: OSPF supports authentication mechanisms to prevent unauthorized routers from participating in routing updates, enhancing netw ork security.
5. Equal-Cost Multipath Routing: OSPF supports load balancing by distributing traffic across multiple equal-cost paths to the same destination.
6. Support for Variable-Length Subnet Masks (VLSM): OSPF includes subnet masks with each advertised destination, enabling the use of VLSM and providing flexibility in network
configuration.
7. Type of Service (ToS) Routing: OSPF can calculate separate routes based on different types of service (ToS), such as low delay, high throughput, or high rel iability, to meet specific
application requirements.
Steps of OSPF Algorithm (Link-State Routing):
1. Neighbor Discovery: Routers use Hello packets to discover their neighbors and establish adjacencies with them.
2. Database Synchronization: After establishing adjacencies, routers exchange Link-State Advertisements (LSAs) to synchronize their link-state databases.
3. Database Flooding: Each router floods its LSAs to all other routers in the area, ensuring that all routers have an identical link -state database.
4. Shortest Path Calculation: Each router independently calculates the shortest paths to all destinations using the Dijkstra algorithm based on the informa tion in its link-state
database.
5. Route Installation: The calculated shortest paths are installed in the routing table, and data packets are forwarded accordingly.
6. Topology Updates: When a network topology change occurs, the affected routers generate new LSAs, which are flooded throughout the area, trigger ing recalculation of shortest
paths and updates to the routing tables.
Computer Networks Page 5
paths and updates to the routing tables.
OSPF Hierarchical Design:
OSPF organizes an AS into a hierarchical structure composed of areas. Each area is a collection of contiguous networks and at tached routers. This hierarchical design provides the
following benefits:
1. Scalability: By dividing the AS into smaller areas, OSPF reduces the amount of routing information exchanged between routers, improving sc alability.
2. Topology Abstraction: The topology of each area is hidden from other areas, reducing the size of the link -state database and the computational overhead.
3. Backbone Area: OSPF uses a backbone area (Area 0) to distribute routing information between non-backbone areas. All other areas must connect to the backbone area, either
directly or through a virtual link.
4. Area Border Routers (ABRs): ABRs connect the backbone area to non-backbone areas and maintain separate link-state databases for each area they participate in.
OSPF provides fast convergence, efficient routing, and enhanced scalability through its hierarchical design, making it suitab le for large and complex networks.
OSPF Message formats
1. Hello Message Format: Hello messages are used to establish and maintain neighbor relationships between routers. They are sent periodically on each OSPF interface to discover and
test the reachability of neighboring routers. The Hello message format includes fields such as the network mask, router prior ity, designated router, backup designated router, and a
list of neighbor IP addresses.
2. Database Description Message Format: These messages are exchanged when an adjacency is being initialized between two routers. They describe the contents of the ro uters' link-
state databases, allowing the routers to synchronize their topological databases. The message format includes fields such as the sequence number, link type, link ID, advertising
router, and link data.
3. Link-State Request Message Format: After exchanging Database Description messages, a router may discover that parts of its link -state database are outdated or missing. It uses Link-
State Request messages to request the updated information from its neighbors. The message format includes fields specifying t he link type, link ID, and advertising router for the
requested link-state advertisements (LSAs).
4. Link-State Update Message Format: Routers use Link-State Update messages to broadcast the status of links and distribute LSAs throughout the area. Each update message contains
a list of LSAs, which describe the state of a router's links or summarize the routing information for networks or autonomous systems outside the area. The message format includes
fields for the number of LSAs, link type, link ID, advertising router, and link data for each LSA.
5. Link-State Acknowledgment Message Format: When a router receives Link-State Update messages, it acknowledges the receipt by sending Link-State Acknowledgment messages.
These messages help ensure reliable flooding of LSAs throughout the area. The message format includes fields specifying the L SAs being acknowledged.
Computer Networks Page 6
Computer Networks Page 7
IP Addressing
IP addressing is a crucial component of the Internet Protocol (IP) that allows devices to communicate with each other over a network. Each device on the network is assigned a unique IP
address, which serves as its logical identifier. IP addresses are represented as a series of four numbers separated by period s, known as dotted-decimal notation.
Classes of IP Addresses:
IP addresses are divided into different classes based on their structure and range. Each class is designed to accommodate net works of varying sizes. Here are the different classes of IP
addresses, along with their examples:
1. Class A:
○ Range: [Link] to [Link]
○ Default Subnet Mask: [Link]
○ Example: [Link]
2. Class B:
○ Range: [Link] to [Link]
○ Default Subnet Mask: [Link]
○ Example: [Link]
3. Class C:
○ Range: [Link] to [Link]
○ Default Subnet Mask: [Link]
○ Example: [Link]
4. Class D:
○ Range: [Link] to [Link]
○ Reserved for multicast addresses
○ Example: [Link]
5. Class E:
○ Range: [Link] to [Link]
○ Reserved for future use, research and military purposes
○ Example: [Link]
Advantages of Classful IP Addressing:
1. Simplicity: Classful IP addressing provides a straightforward way to determine the network and host portions of an IP address, making it easier to manage and configure networks.
2. Hierarchical Structure: The class-based addressing scheme allows for a hierarchical structure, where larger networks can be divided into smaller subnets for be tter organization and
management.
3. Address Space Conservation: By allocating different address ranges for networks of varying sizes, classful IP addressing helps conserve the limited IP ad dress space.
Disadvantages of Classful IP Addressing:
1. Inefficient Address Utilization: Classful IP addressing can lead to inefficient address utilization, especially for organizations that require a number of hos ts that does not fit neatly
into a specific class. This can result in wasted addresses.
2. Limited Flexibility: The fixed boundary between network and host portions of an IP address in classful addressing makes it difficult to adapt to c hanging network requirements.
3. Address Depletion: With the rapid growth of the Internet and the increasing number of devices, the limited address space available in classful I P addressing became a significant
concern, leading to the eventual adoption of classless IP addressing (CIDR).
Computer Networks Page 8
Classless Addressing (CIDR)
Classless Inter-Domain Routing (CIDR) is a method of IP addressing and routing that replaced the traditional classful IP addressing scheme. C IDR introduces a more flexible and efficient
way of allocating IP addresses by allowing variable-length subnet masks (VLSM) and supernetting techniques.
In CIDR, IP addresses are represented using a notation that combines the IP address and the subnet mask length, separated by a forward slash (/). For example, [Link]/24
represents an IP address with a 24-bit subnet mask ([Link]).
Comparison between Classful IP Addressing and Classless Addressing (CIDR):
1. Address Allocation:
○ Classful: IP addresses are allocated based on predefined address classes (A, B, C, D, E), with fixed subnet mask lengths.
○ Classless (CIDR): IP addresses are allocated using variable-length subnet masks, allowing more flexible and efficient address distribution.
2. Address Space Utilization:
○ Classful: Address space utilization is often inefficient, as organizations may end up with unused addresses due to the fixed subnet mask lengths.
○ Classless (CIDR): CIDR enables more efficient use of available address space by allowing subnet masks to be adjusted based on the actual network size requirements.
3. Routing Tables:
○ Classful: Routing tables contain individual entries for each network, leading to larger routing table sizes as the number of networks increases.
○ Classless (CIDR): CIDR allows for route aggregation, where multiple networks can be represented by a single entry in the rout ing table, resulting in smaller and more manageable
routing tables.
4. Scalability:
○ Classful: Classful addressing has limited scalability due to the fixed address classes and subnet mask lengths, making it challenging to accommodate rapidly growing networks.
○ Classless (CIDR): CIDR provides better scalability as it can handle larger networks and more efficient address allocation, making it suitable for the ever-expanding Internet.
5. Flexibility:
○ Classful: Classful addressing lacks flexibility, as the network and host portions of an IP address are fixed based on the add ress class.
○ Classless (CIDR): CIDR offers greater flexibility by allowing organizations to choose the appropriate subnet mask length base d on their specific network requirements.
6. Address Conservation:
○ Classful: Classful addressing can lead to address wastage, especially for organizations that require a number of hosts that does not fit neatly into a specific address class.
○ Classless (CIDR): CIDR promotes better address conservation by allowing organizations to allocate addresses more precisely, m inimizing wasted address space.
7. Routing Updates:
○ Classful: In classful routing, routers need to maintain individual entries for each network, resulting in larger routing upda te messages and increased overhead.
○ Classless (CIDR): With CIDR, route aggregation reduces the size of routing update messages, as multiple networks can be represented by a single entry, decreasing routing
overhead and improving performance.
Overall, CIDR addresses the limitations of classful IP addressing by introducing a more flexible and efficient way of allocat ing IP addresses. It promotes better address space utilization,
improves scalability, and reduces routing overhead, making it a crucial component of modern IP networking and the foundation for the continued growth and expansion of the Internet.
Computer Networks Page 9
Subnetting
Subnetting is the process of dividing a larger network into smaller, more manageable subnetworks or subnets. It allows networ k administrators to segment a single network
address space into multiple logical subnetworks, each with its own distinct address range.
The primary purpose of subnetting is to improve network organization, security, and efficient use of IP addresses. By dividin g a network into smaller subnets, it becomes easier to
manage traffic, apply access control policies, and optimize network performance.
Advantages of Subnetting:
1. Improved Network Organization and Management: Subnetting enables the logical division of a network into smaller, more manageable segments. This makes it easier to
identify and isolate network issues, apply security policies, and manage traffic more effectively.
2. Efficient Use of IP Addresses: Subnetting allows for better utilization of available IP addresses by dividing a large network into smaller subnetworks. This helps conserve IP
address space and prevents address depletion.
3. Increased Security: By creating separate subnetworks, network administrators can implement security measures such as firewalls, access control li sts (ACLs), and virtual local
area networks (VLANs) to control traffic flow and enforce security policies between different subnets.
4. Reduced Network Traffic: Subnetting can help minimize broadcast traffic by confining it within individual subnets, rather than allowing it to propagat e across the entire
network. This improves network performance and reduces unnecessary overhead.
5. Simplified Routing: Subnetting can simplify routing by allowing routers to maintain summarized routing information for each subnet, rather than i ndividual host addresses. This
reduces the size of routing tables and improves routing efficiency.
Disadvantages of Subnetting:
1. Increased Administrative Overhead: Subnetting introduces additional administrative tasks, such as designing and managing subnet addressing schemes, configuring routing
protocols, and maintaining consistent subnet configurations across the network.
2. Potential for Address Depletion: If subnetting is not planned and implemented properly, it can lead to inefficient use of IP addresses, resulting in address d epletion within
individual subnets.
3. Complexity in Network Changes: Modifying or expanding subnets can be complex, as it may require reconfiguration of routing protocols, addressing schemes, an d network
devices.
4. Potential for Routing Errors: Improper subnet configurations or routing table entries can lead to routing errors, causing network connectivity issues or in efficient traffic flow.
Example of Subnetting:
Consider an organization with the IP address range [Link]/24 (subnet mask [Link]). This network can accommodate u p to 254 hosts (excluding the network and
broadcast addresses).
To create smaller subnetworks, the organization can use subnetting to divide the original network into smaller subnets. For e xample, they can create four subnetworks using a
Computer Networks Page 10
To create smaller subnetworks, the organization can use subnetting to divide the original network into smaller subnets. For e xample, they can create four subnetworks using a
subnet mask of [Link] (/26).
The resulting subnets would be:
1. [Link]/26 ([Link] - [Link]) - Subnet 1
2. [Link]/26 ([Link] - [Link]) - Subnet 2
3. [Link]/26 ([Link] - [Link]) - Subnet 3
4. [Link]/26 ([Link] - [Link]) - Subnet 4
Each subnet can now accommodate up to 62 hosts (excluding the network and broadcast addresses). Network administrators can as sign these subnets to different departments,
locations, or applications within the organization, providing better organization, security, and management of network resour ces.
Subnetting is a crucial technique in IP networking, allowing organizations to effectively manage and optimize their network i nfrastructure while ensuring efficient use of IP
addresses and improving network security and performance.
IPv4
IPv4 is the fourth version of the Internet Protocol and is the primary addressing protocol used for communication over the in ternet and most private networks. An IPv4 address is a 32-bit
numeric address written in decimal and dotted-decimal notation, consisting of four octets (groups of eight bits) separated by periods.
IP is an unreliable and connectionless best-effort delivery service protocol. By best effort we mean that there is no error and flow control. However, IP performs error detection and
discards a packet, if it is corrupted. To achieve reliability, it is necessary to combine it with a reliable protocol such as TCP. Packets in IP layer are called datagrams.
Here are the fields of an IPv4 address and their brief explanations:
1. Version (4 bits): This field indicates the version of the IP protocol being used. For IPv4, this value is always set to 0100 (binary) or 4 (dec imal).
2. Internet Header Length (IHL) or Header Length (4 bits): This field specifies the length of the IPv4 header in 32-bit words (4-byte chunks). The minimum value is 5 (20 bytes), and the
maximum value is 15 (60 bytes).
3. Differentiated Services Code Point (DSCP) or Type of Service (ToS) (8 bits): This field is used for quality of service (QoS) and traffic prioritization. It was previously known as the Type
of Service (ToS) field.
4. Explicit Congestion Notification (ECN) (2 bits): This field is used for explicit congestion notification, a mechanism for end -to-end notification of network congestion.
5. Total Length (16 bits): This field specifies the total length of the IP datagram (header + data) in bytes.
6. Identification (16 bits): This field is used for unique identification of IP datagrams when they are fragmented during transmission.
7. Flags (3 bits): This field consists of various control flags related to fragmentation:
○ Bit 0: Reserved (must be zero)
○ Bit 1: Don't Fragment (DF)
○ Bit 2: More Fragments (MF)
8. Fragment Offset (13 bits): This field indicates the position of a fragment in the original IP datagram, allowing for proper reassembly of fragmented pac kets.
9. Time to Live (TTL) (8 bits): This field specifies the maximum number of routers the IP datagram can traverse before being discarded. It is used to prevent packets from circulating
indefinitely in the network.
10. Protocol (8 bits): This field identifies the higher-level protocol to which the data portion of the IP datagram should be delivered (e.g., TCP, UDP, ICMP).
11. Header Checksum (16 bits): This field contains a checksum value calculated based on the IP header for error detection and validation purposes.
12. Source IP Address (32 bits): This field specifies the IPv4 address of the source device that originated the IP datagram.
13. Destination IP Address (32 bits): This field specifies the IPv4 address of the destination device to which the IP datagram is being sent.
14. Options (variable length): This optional field allows for the inclusion of additional control or routing information within the IP header.
15. Data (variable length): This field contains the data payload being carried by the IP datagram, which can be data from higher -level protocols like TCP or UDP.
Computer Networks Page 11
IPv6 (Internet Protocol Version 6)
IPv6 is the most recent version of the Internet Protocol, designed as the successor to IPv4. It was developed to address the issue of IPv4 address depletion and to introduce
additional features and improvements. An IPv6 address is a 128-bit numeric address represented in hexadecimal notation, consisting of eight groups of four hexadecimal digits
separated by colons.
Here are the fields of an IPv6 address and their brief explanations:
1. Version (4 bits): This field indicates the version of the IP protocol being used. For IPv6, this value is always set to 0110 (binary) or 6 (dec imal).
2. Traffic Class (8 bits): This field is similar to the Differentiated Services Code Point (DSCP) field in IPv4 and is used for quality of service (QoS) and traffic prioritization.
3. Flow Label (20 bits): This field is used for identifying and labeling a sequence of packets belonging to the same flow or communication session, en abling efficient handling of
real-time data streams.
4. Payload Length (16 bits): This field specifies the length of the IPv6 payload (data portion) in octets (8-bit bytes).
5. Next Header (8 bits): This field identifies the type of the next extension header or the higher-level protocol (e.g., TCP, UDP, ICMPv6) to which the data portion should be
delivered.
6. Hop Limit (8 bits): This field specifies the maximum number of hops (routers) the IPv6 packet can traverse before being discarded, similar to the Time to Live (TTL) field in
IPv4.
7. Source IPv6 Address (128 bits): This field specifies the IPv6 address of the source device that originated the IPv6 packet.
8. Destination IPv6 Address (128 bits): This field specifies the IPv6 address of the destination device to which the IPv6 packet is being sent.
Additionally, IPv6 supports various extension headers that can be optionally included after the main IPv6 header. These exten sion headers provide additional functionality and
options, such as:
1. Hop-by-Hop Options Header: This header carries optional information that must be examined by every node along the packet's delivery path.
2. Routing Header: This header is used for specifying a list of intermediate nodes (routers) that the packet should traverse.
3. Fragment Header: This header is used for fragmentation and reassembly of IPv6 packets when the payload exceeds the maximum transmission unit ( MTU) size.
4. Authentication Header (AH): This header provides data integrity, authentication, and anti-replay protection for the entire IPv6 packet, including the extension headers.
5. Encapsulating Security Payload (ESP) Header: This header provides confidentiality, data origin authentication, and anti-replay protection for the IPv6 payload.
IPv6 addresses and these header fields enable more efficient routing, improved security, and better support for emerging tech nologies and applications. While the transition
from IPv4 to IPv6 is ongoing, IPv6 is designed to coexist with IPv4 and provide a smooth migration path for the future of the internet and networking technologies.
• Address Space: IPv6 offers a significantly larger address space compared to IPv4, which is essential to
accommodate the growing number of devices and facilitate the expansion of the internet.
• Header Format: IPv6 has a simpler and more efficient header format, with fixed-length fields and
extension headers for optional features.
• Fragmentation: In IPv6, fragmentation is handled only by the sender, reducing the processing overhead
on routers.
• Security: IPv6 has built-in support for IPsec, providing end-to-end encryption and authentication
capabilities.
• Autoconfiguration and Mobility: IPv6 offers improved support for automatic address configuration and
better mobility features, enabling seamless connectivity for mobile devices.
• Multicast: IPv6 enhances multicast capabilities, enabling efficient delivery of data to multiple
destinations.
• Transition Mechanisms: Various transition mechanisms, such as dual-stack, tunneling, and translation,
are employed to facilitate the coexistence and gradual migration from IPv4 to IPv6.
Computer Networks Page 12
ICMP (Internet Control Message Protocol)
ICMP is a supporting protocol in the Internet protocol suite used for diagnostic and control purposes. It is an integral partof the IP protocol and is used by network devices (such
as routers and hosts) to communicate various error conditions, control messages, and operational information related to IP packet processing.
Features of ICMP:
1. Error Reporting: ICMP is primarily used to report errors encountered during the processing of IP packets. For example, if a router cannot forw ard a packet due to a network
error, it can send an ICMP error message back to the source.
2. Diagnostic Utilities: ICMP provides diagnostic utilities like the "ping" command, which uses ICMP Echo Request and Echo Reply messages to test conn ectivity and measure
round-trip times between hosts.
3. Network Reachability: ICMP can be used to determine if a remote host or network is reachable by sending Echo Request messages and waiting for Echo Reply messages.
4. Packet Filtering: ICMP messages can be used by routers and firewalls to filter or block certain types of traffic based on the ICMP message type .
5. Path MTU Discovery: ICMP can be used for Path MTU (Maximum Transmission Unit) Discovery, a technique that allows hosts to determine the maximum packet size that can
be transmitted without fragmentation along a particular path.
6. Router Discovery and Redirection: Some ICMP messages can be used by hosts to discover routers on the network and by routers to redirect hosts to better routes.
Advantages of ICMP:
1. Network Troubleshooting: ICMP provides valuable diagnostic and error reporting capabilities that assist in network troubleshooting and identifying iss ues.
2. Network Mapping: ICMP utilities like "traceroute" can be used to map the path taken by packets through a network, helping to identify routin g issues or bottlenecks.
3. Connectivity Testing: The ability to test connectivity between hosts using ICMP Echo Request/Reply messages is a valuable tool for network administ rators.
4. Efficient Network Operation: ICMP messages can help routers and hosts operate more efficiently by providing information about network conditions and error s.
Disadvantages of ICMP:
1. Security Concerns: ICMP can be exploited for reconnaissance and network mapping purposes by attackers, potentially revealing sensitive informati on about the network
topology and active hosts.
2. Bandwidth Consumption: In certain scenarios, excessive ICMP traffic (e.g., broadcast ICMP messages) can consume network bandwidth and potentially le ad to denial-of-
service (DoS) attacks.
3. Potential for Abuse: ICMP messages can be spoofed or manipulated by attackers to perform various types of attacks, such as ICMP floods or ICMP r edirects.
4. Limited Functionality: While ICMP provides useful diagnostic and control capabilities, it has limited functionality compared to more advanced netw ork management
protocols like SNMP (Simple Network Management Protocol).
To mitigate the potential security risks associated with ICMP, many organizations implement ICMP filtering or rate-limiting techniques on their firewalls and routers. Additionally,
modern security practices often recommend disabling or restricting unnecessary ICMP message types to reduce the attack surface.
ARP (Address Resolution Protocol)
ARP is a communication protocol used in computer networks to map or resolve a network layer address (IP address) to a data link layer address (MAC address). It is a crucial
protocol for enabling communication between devices on a local area network (LAN).
Features of ARP:
1. Address Resolution: ARP's primary function is to resolve or map an IP address to its corresponding MAC address. This is necessary because IP pack ets are delivered across
networks based on IP addresses, but at the data link layer (Ethernet or Wi -Fi), frames are transmitted using MAC addresses.
2. Request and Reply Mechanism: ARP operates by broadcasting an ARP Request message on the local network, asking for the MAC address associated with a specif ic IP
address. The device with the requested IP address responds with an ARP Reply message, providing its MAC address.
3. ARP Cache: Each device on the network maintains an ARP cache, which stores the IP-to-MAC address mappings for recently resolved addresses. This cache helps reduce the
need for broadcasting ARP requests for every communication, improving efficiency.
4. Dynamic Updates: ARP caches are dynamically updated as new requests and replies are received. Entries in the ARP cache have a limited lifetime and are periodically
refreshed or removed if not used.
5. Gratuitous ARP: ARP also supports a feature called "Gratuitous ARP," where a device can announce its IP -to-MAC address mapping to the entire network without being
prompted by a request. This is useful when a device's IP address or MAC address changes, allowing it to update other devices on the network.
6. Reverse ARP (RARP): Reverse ARP (RARP) is a variant of ARP that allows a device to request its IP address by providing its MAC address. This is u seful in scenarios where a
device needs to obtain an IP address dynamically, such as in diskless workstations or embedded systems.
Advantages of ARP:
• Enables communication between devices on a LAN by resolving IP addresses to MAC addresses.
• Provides a dynamic and distributed mechanism for address resolution, reducing the need for manual configuration.
• Supports efficient caching of resolved addresses, improving performance and reducing network overhead.
• Allows for automatic updates and adaptation to changes in IP-to-MAC address mappings.
Disadvantages of ARP:
• Limited to local area networks (LANs) and cannot operate across routers or wide area networks (WANs).
• Vulnerable to security threats like ARP spoofing or ARP cache poisoning attacks, where an attacker can redirect traffic by pr oviding false IP-to-MAC address mappings.
• Broadcasts ARP requests, which can contribute to network overhead, especially in large networks with frequent address resolut ion requests.
• Relies on flat network topologies and does not scale well to large, hierarchical networks.
Network Address Translation (NAT)
Network Address Translation (NAT) is a technique used in computer networking that allows multiple devices on a private network (such as a local area network or LAN) to share a
single public IP address for accessing the internet or another network. NAT acts as an intermediary, translating the private IP addresses used within the local network into a public
IP address and vice versa.
Features of NAT:
1. IP Address Conservation: NAT helps to conserve the limited pool of publicly routable IP addresses by allowing multiple devices to share a single publi c IP address. This has
Computer Networks Page 13
1. IP Address Conservation: NAT helps to conserve the limited pool of publicly routable IP addresses by allowing multiple devices to share a single publi c IP address. This has
become increasingly important due to the exhaustion of IPv4 address space.
2. Private IP Address Usage: NAT allows the use of private IP addresses (as defined in RFC 1918) on the local network, which are not routable on the publi c internet. These
private IP addresses can be reused across different networks without causing conflicts.
3. Network Security: NAT provides a level of security by hiding the private IP addresses of devices on the local network from the public internet. This makes it more difficult for
external hosts to directly access or attack devices on the private network.
4. Port Forwarding/Port Mapping: NAT allows the mapping of specific ports on the public IP address to specific devices or services on the private network. T his feature is
commonly used for hosting servers or services accessible from the internet.
5. Network Address/Port Translation (NAPT): NAPT, also known as Port Address Translation (PAT) or Overload, is a variation of NAT that allows multiple private IP address es to
be mapped to a single public IP address using different source ports. This enables even more efficient use of public IP addre sses.
6. Symmetric NAT and Cone NAT: NAT implementations may use different mapping behaviors, such as Symmetric NAT (where the same internal IP and port are map ped to
different external ports for each external destination) or Cone NAT (where the same external port is used for all destination s).
7. Application-Level Gateways (ALGs): Some NAT devices include Application-Level Gateways (ALGs) that can interpret and modify the payload of specific application protocols
(e.g., SIP, FTP) to ensure proper translation of embedded IP addresses and ports.
Advantages of NAT:
• Conserves public IP addresses, allowing multiple devices to share a single public IP address.
• Provides a level of security by hiding private IP addresses from the public internet.
• Allows the use of private IP address ranges on local networks, avoiding conflicts with public IP addresses.
• Supports port forwarding/mapping for hosting servers or services on the local network.
Disadvantages of NAT:
• Breaks certain applications or protocols that embed IP addresses within the payload, requiring ALGs or special configurations .
• Introduces complexity in peer-to-peer applications and client-server communication, as both endpoints need to be aware of the NAT mappings.
• Can create complications for certain network security protocols, such as IPsec, which assume end -to-end communication.
• Adds an extra layer of complexity and configuration for network administrators.
NAT has become a widely adopted technique in modern networks, particularly in home and small office environments, as it helpsto mitigate the shortage of publicly routable
IPv4 addresses. However, with the deployment of IPv6, which provides a vastly larger address space, the need for NAT may diminish in the future.
Computer Networks Page 14
Unit - 5 Transport layer and Congestion
Saturday, April 20, 2024 4:43 PM
TCP (Transmission Control Protocol)
TCP is a core protocol in the Internet Protocol Suite, operating at the transport layer. It is a connection -oriented, reliable, and byte-stream protocol designed to provide end-to-end
communication between applications running on different hosts across a network.
Features of TCP:
1. Connection-Oriented: TCP establishes a logical end-to-end connection between two hosts before data transmission begins. This connection is established through a three -way
handshake process, ensuring reliable communication.
2. Reliable Data Transfer: TCP ensures reliable data delivery by implementing mechanisms such as sequencing, acknowledgments, retransmissions, and check sums. It guarantees
that data arrives at the destination in the correct order and without errors or duplication.
3. Flow Control: TCP implements flow control mechanisms to prevent the sender from overwhelming the receiver with data. The receiver can adver tise a receive window size,
indicating the amount of data it can accept at a time.
4. Congestion Control: TCP includes congestion control algorithms, such as slow start, congestion avoidance, and fast retransmit/fast recovery, to d etect and respond to network
congestion. These algorithms adjust the sending rate to prevent overwhelming the network and improve overall performance.
5. Byte-Stream Service: TCP treats the data as a continuous stream of bytes, rather than individual packets or messages. The receiving application ca n read the data as a continuous
stream, without worrying about the underlying packet boundaries.
6. Full-Duplex Communication: TCP supports full-duplex communication, allowing data to be transmitted simultaneously in both directions between the connected hosts.
7. Data Segmentation and Reassembly: TCP divides the application data into segments, which are then encapsulated into IP packets for transmission over the network . At the
receiving end, TCP reassembles the segments into the original byte stream.
8. Multiplexing and Demultiplexing: TCP allows multiple applications on a single host to communicate concurrently by using port numbers to identify and different iate between
different connections.
9. Error Detection and Recovery: TCP uses checksums and sequence numbers to detect errors in the received data and initiate retransmissions or request retrans missions from the
sender, ensuring reliable data delivery.
10. Connection Termination: TCP provides a graceful connection termination process, ensuring that all data is reliably delivered before closing the conne ction.
Advantages of TCP:
• Reliable end-to-end data transfer
• Flow control and congestion control mechanisms
• Guaranteed in-order delivery of data
• Connection-oriented communication for consistent data streams
• Error detection and recovery mechanisms
Disadvantages of TCP:
• Additional overhead due to connection establishment, acknowledgments, and retransmissions
• Potential for head-of-line blocking, where out-of-order segments can delay the delivery of subsequent data
• Limited performance for applications that require low latency or high throughput
TCP is widely used for applications that require reliable data transfer, such as web browsing, file transfers, email, and rem ote access services. It provides robust mechanisms for
ensuring data integrity and reliability, making it a crucial protocol for many internet applications and services.
UDP (User Datagram Protocol)
UDP is a core protocol in the Internet Protocol Suite, operating at the transport layer. It is a connectionless, unreliable, and datagram-oriented protocol designed for efficient data
transfer in scenarios where reliability is not critical or can be handled by the application layer.
Features of UDP:
1. Connectionless: UDP is a connectionless protocol, meaning that it does not establish a dedicated end-to-end connection between the communicating hosts before data
transmission. Each UDP datagram is treated independently, without any prior handshaking or connection establishment.
2. Unreliable Data Transfer: UDP does not provide any mechanisms for guaranteed delivery, error checking, or retransmissions. Datagrams sent via UDP may a rrive out of order, be
duplicated, or go missing without any notification.
3. Datagram-Oriented: UDP treats data as individual, self-contained datagrams or packets, rather than a continuous stream of bytes. Each datagram is independent and contains
source and destination port numbers for multiplexing and demultiplexing.
4. No Flow Control or Congestion Control: UDP does not implement any flow control or congestion control mechanisms. It is the responsibility of the application layer o r higher-
level protocols to handle these aspects, if required.
5. Low Overhead: UDP has a simple header structure and lacks the additional overhead associated with connection establishment, acknowledgments , and retransmissions found in
TCP. This makes it more efficient for applications that prioritize speed over reliability.
6. Multiplexing and Demultiplexing: Similar to TCP, UDP uses port numbers to identify and differentiate between different applications or services running on the same host.
7. Lightweight and Fast: Due to its simplicity and lack of reliability mechanisms, UDP is generally faster and more efficient than TCP, making it suit able for applications that require
low latency and high throughput.
8. Broadcast and Multicast Support: UDP supports broadcasting and multicasting, allowing data to be sent to multiple destinations simultaneously, making it usefu l for applications
like video streaming, online gaming, and file distribution.
Advantages of UDP:
• Low overhead and efficient data transfer
• Suitable for applications that prioritize speed over reliability
• Ideal for time-sensitive applications like video streaming, online gaming, and voice over IP (VoIP)
Computer Networks Page 1
• Ideal for time-sensitive applications like video streaming, online gaming, and voice over IP (VoIP)
• Supports broadcasting and multicasting
Disadvantages of UDP:
• No guaranteed delivery or data integrity mechanisms
• No flow control or congestion control mechanisms
• Applications need to implement their own reliability and error handling mechanisms
• Potential for packet loss or out-of-order delivery
UDP is commonly used in applications where some data loss is acceptable or can be handled by the application layer, such as v ideo streaming, online gaming, Domain Name System
(DNS) queries, and real-time multimedia applications. It provides a simple and efficient way to transmit data without the overhead of TCP's reliabili ty mechanisms, making it suitable
for scenarios where speed and low latency are priorities.
Congestion
Congestion in computer networks refers to the state where the demand for network resources exceeds the available capacity, re sulting in excessive delays, packet losses, and poor
overall performance.
Causes of Congestion:
1. Insufficient Bandwidth: When the amount of traffic on a network link or path exceeds the available bandwidth, congestion can occur. This can happen d ue to an increase in the
number of users, applications with high bandwidth demands, or inefficient bandwidth allocation.
2. Bursty Traffic: Some applications, such as file transfers or multimedia streaming, generate traffic in bursts, which can lead to temporary co ngestion if the network resources are
not capable of handling these bursts effectively.
3. Broadcast Storms: In networks with broadcast or multicast traffic, excessive broadcast or multicast packets can cause congestion by overwhelmin g network devices and
consuming significant bandwidth.
4. Bottlenecks: Congestion can occur at specific points in the network where there are bottlenecks, such as slower links, overloaded routers, or mismatched interface speeds
between network components.
5. Inadequate Buffering: Insufficient buffer space in network devices like routers or switches can lead to packet drops and congestion when traffic bu rsts exceed the available buffer
capacity.
6. Network Attacks: Malicious network attacks, such as Denial of Service (DoS) or Distributed Denial of Service (DDoS) attacks, can intentionally generate excessive traffic, leading to
congestion and disruption of network services.
Effects of Congestion:
1. Increased Latency: Congestion can cause significant delays in packet delivery, resulting in higher latency and poor performance for time -sensitive applications like Voice over IP
(VoIP) or online gaming.
2. Packet Loss: When network devices become overwhelmed with traffic, they may start dropping packets due to buffer overflows or resource exh austion, leading to data loss and
retransmissions.
3. Throughput Degradation: Congestion can reduce the overall throughput of the network, as packets experience longer queuing delays, retransmissions, an d increased contention
for limited resources.
4. Quality of Service (QoS) Degradation: Applications with specific QoS requirements, such as voice or video streaming, may experience poor quality or service disrupt ions due to
congestion-induced packet loss and delay.
5. Network Instability: Severe congestion can lead to network instability, where routing protocols or other network mechanisms may fail to operate co rrectly, potentially causing
further disruptions or even network outages.
6. Application Performance Issues: Congestion can negatively impact the performance of applications that rely on network communication, leading to slow response times,
incomplete data transfers, or application failures.
To mitigate congestion and its effects, network administrators employ various techniques, such as bandwidth management, traff ic shaping, load balancing, QoS mechanisms, and
network capacity planning. Additionally, congestion control algorithms, such as those implemented in TCP, aim to detect and r espond to congestion by adjusting the transmission rate
and preventing further congestion build up.
Congestion Control Techniques
Open Loop Techniques: These techniques try to prevent or avoid congestion by making decisions upfront, without considering the current state of the network. Some algorithms that
fall under open loop techniques mentioned in the document are:
1. Leaky Bucket Algorithm
2. Token Bucket Algorithm
Closed Loop Techniques: These techniques allow the network to enter a congested state, detect the congestion, and then take corrective measures. Some closed loop techniques
mentioned in the document are:
1. Admission Control
2. Choke Packets
3. Hop-by-Hop Choke Packets
4. Load Shedding
5. Slow Start (a proactive technique)
The document also mentions that closed loop algorithms can be further divided into explicit feedback algorithms (like Choke P ackets) and implicit feedback algorithms (like Slow Start,
where the source deduces congestion based on local observations).
Leaky Bucket Algorithm:
The leaky bucket algorithm is an open-loop congestion control technique that works on the principle of a metaphorical bucket with a small hole at the bottom. The b ucket represents
a buffer, and the hole represents the network interface's constant output rate. Here's how it works:
1. When a host has a packet to send, the packet is placed into the bucket (buffer).
2. The bucket has a fixed capacity, and any packets that arrive when the bucket is full are discarded.
3. The bucket leaks at a constant rate, meaning that the network interface transmits packets at a constant rate, determined by t he size of the hole.
4. This algorithm converts bursty traffic from the host into a uniform stream of packets.
The implementation of the leaky bucket algorithm typically involves a finite queue that outputs packets at a finite rate. If there is room in the queue, incoming packets are queued;
otherwise, they are discarded.
Advantages:
• Simple implementation
• Enforces a constant output rate
• Prevents bursts from overwhelming the network
Disadvantages:
Computer Networks Page 2
Disadvantages:
• Inflexible, as it enforces a rigid output pattern
• Excess packets are discarded, leading to potential data loss
• Does not adapt to network conditions or available bandwidth
Token Bucket Algorithm:
The token bucket algorithm is an enhancement over the leaky bucket algorithm, designed to provide more flexibility and better utilize available bandwidth. It works on the concept of
a bucket that holds tokens, which represent permission to transmit packets.
1. Tokens are generated at regular intervals and added to the bucket.
2. The bucket has a maximum capacity, limiting the number of tokens it can hold.
3. When a packet is ready to be sent, a token is removed from the bucket, and the packet is transmitted.
4. If there are no tokens in the bucket, the packet cannot be sent and must wait until tokens become available.
The token bucket algorithm allows bursty traffic to be transmitted as long as there are tokens available in the bucket. Howev er, the limit of the burst is restricted by the number of
tokens in the bucket at any given time.
Advantages:
• Flexibility: Allows for bursts of traffic when tokens are available, leading to better network utilization.
• Burst Tolerance: Can handle short bursts of traffic more effectively by accumulating tokens during periods of low traffic.
• Fairness: Regulates traffic flow based on tokens, ensuring fairness among different traffic sources.
• Efficient Bandwidth Utilization: Can utilize available bandwidth more efficiently by transmitting bursts when possible.
Disadvantages:
• More complex implementation compared to the leaky bucket algorithm.
• Requires careful configuration of token generation rate and bucket size to balance burst tolerance and fairness.
Comparison and Superiority:
While both algorithms aim to regulate traffic flow and prevent congestion, the token bucket algorithm is generally considered superior to the leaky bucket algorithm for several
reasons:
1. Flexibility: The token bucket algorithm allows for more flexibility in handling bursty traffic, whereas the leaky bucket algorithm enforce s a rigid pattern at the output stream,
regardless of the input pattern.
2. Efficiency: The token bucket algorithm can utilize the available bandwidth more efficiently by allowing bursts of traffic when tokens are available, leading to better network
utilization.
3. Burst Tolerance: The token bucket algorithm can handle short bursts of traffic more effectively, as it allows the accumulation of tokens durin g periods of low traffic, which can be
used to transmit bursts later.
4. Fairness: By regulating the traffic flow based on tokens, the token bucket algorithm ensures fairness among different traffic sources , preventing any single source from
monopolizing the available bandwidth.
However, it's important to note that the choice between these algorithms depends on the specific requirements and constraints of the network environment. In scenarios where a
strict, constant rate of traffic is desired, the leaky bucket algorithm may be more suitable, while the token bucket algorithm is generally preferred when dealing with bursty traffic and
the need for more flexible bandwidth utilization.
The token bucket algorithm is widely used in various networking applications, such as traffic shaping, rate limiting, and qua lity of service (QoS) mechanisms, due to its ability to
provide controlled bursts while maintaining overall bandwidth constraints.
Token bucket
Leaky bucket
Closed loop congestion control techniques
Admission Control:
Admission control is a closed-loop congestion control technique used in virtual circuit networks. It involves regulating the establishment of new connections based on the current
state of the network. Here's how it works:
1. The network constantly monitors its resources and utilization levels.
2. When congestion is detected, the network can take one of the following actions:
○ Deny new connections: No new virtual circuits or connections are established until the congestion subsides. This approach is commonly used in telephone networks, where
new calls are blocked when the exchange is overloaded.
○ Careful routing: New connections are allowed, but they are routed carefully to avoid congested areas or routers within the network.
○ Negotiation: During connection setup, the host specifies its traffic requirements (volume, quality of service, maximum delay, etc.), and the network reserves the necessary
resources along the path before allowing the actual data transfer.
Computer Networks Page 3
resources along the path before allowing the actual data transfer.
Admission control ensures that new connections are only admitted if the network has sufficient resources to accommodate them without degrading the performance of existing
connections.
Choke Packets:
Choke packets are a closed-loop congestion control technique used in both virtual circuit and datagram networks. It involves sending explicit feedback to the source when congestion
is detected.
1. Each router monitors its resources and output line utilization.
2. If the utilization of an output line exceeds a predefined threshold, it enters a "warning" state.
3. The router sends a choke packet back to the source of the traffic causing the congestion.
4. The original packet is tagged (a bit is set in the header) to prevent other routers along the path from generating additional choke packets for the same packet.
5. Upon receiving a choke packet, the source reduces its traffic to the specified destination by a fixed percentage (e.g., 50%).
6. If subsequent choke packets are received for the same destination, the source further reduces its traffic by a smaller percentage (e.g., 25%).
The choke packet technique provides explicit feedback to the source, allowing it to adjust its transmission rate and alleviate congestion.
Hop-by-Hop Choke Packets:
Hop-by-Hop choke packets are an advancement over the traditional choke packet technique. They are designed to address the issue of high-speed, long-distance links, where sending
a choke packet all the way back to the source may not be effective, as many packets may have already been transmitted before the choke packet reaches the source.
Here's how Hop-by-Hop choke packets work:
1. When a router detects congestion, it sends a choke packet back towards the source.
2. As the choke packet traverses the path back to the source, each intermediate router along the way curtails the traffic flow between itself and the next upstream router.
3. This immediate reduction in traffic flow at each hop allows for a more rapid response to congestion, as opposed to waiting for the choke packet to reach the source.
4. Intermediate routers must dedicate additional buffers to accommodate the incoming traffic until the upstream routers reduce their transmission rates.
The Hop-by-Hop choke packet algorithm provides a faster response to congestion by gradually reducing the traffic flow at each hop, rather than waiting for the choke packet to reach
the source before any action is taken.
Both the choke packet and Hop-by-Hop choke packet techniques are closed-loop congestion control mechanisms that rely on explicit feedback to the source or intermediate routers
to adjust the traffic flow and alleviate congestion.
Limitations of Choke Packets and Hop-by-Hop Choke Packets:
While choke packets and Hop-by-Hop choke packets are effective congestion control techniques, they have some limitations:
1. Overhead: Sending choke packets introduces additional overhead and traffic into the network, which can further contribute to congestion, especially in cases of severe
congestion.
2. Delayed Response: In large networks with high propagation delays, the time it takes for choke packets to reach the source or intermediate routers can result in a delayed
response to congestion.
3. Granularity: Choke packets typically instruct sources or routers to reduce their transmission rates by a fixed percentage, which may not be optimal for all scenarios. More granular
control over the rate adjustment may be desirable.
4. Synchronization: If multiple sources receive choke packets simultaneously, they may all reduce their transmission rates in synchrony, leading to oscillations in network utilization
and potential instability.
5. Fairness: The choke packet mechanism does not inherently ensure fairness among different traffic flows, as sources may respond differently to choke packets based on their
individual implementations.
6. Complexity: Implementing Hop-by-Hop choke packets can be more complex than traditional choke packets, as it requires coordination among multiple routers along the path.
Despite these limitations, choke packets and Hop-by-Hop choke packets remain useful tools in congestion control, especially in scenarios where explicit feedback is preferred over
implicit congestion detection mechanisms.
Load Shedding:
Load shedding is a simple and effective closed-loop congestion control technique. It involves selectively dropping packets when congestion is detected in the network.
1. When a router or network device detects congestion, it starts dropping packets from the incoming traffic.
2. There are different methods for selecting which packets to drop:
○ Random Drop: Packets are randomly selected and dropped, regardless of their priority or importance.
○ Priority-based Drop: Packets are marked with different priority levels by the sender, and the router drops packets from lower priority classes first, preserving higher priority
traffic.
3. By dropping packets, the router or network device reduces the overall load on the network, alleviating congestion.
Load shedding is a reactive technique that is triggered when congestion is detected. It is a simple and effective way to reduce network load, but it comes at the cost of potential data
loss and reduced throughput for affected flows.
Flow Control vs Congestion Control:
While flow control and congestion control are related concepts, they serve different purposes and operate at different levels. Let's explore the differences between the two in detail.
Flow Control:
Flow control is a mechanism that regulates the transmission of data between two directly communicating devices or nodes in a network. It is a point-to-point mechanism that
operates at the data link or transport layer of the OSI model. The primary goal of flow control is to prevent the sender from overwhelming the receiver with data, ensuring that the
receiver's buffer does not overflow.
Flow control involves the following key aspects:
• It is implemented through feedback mechanisms, where the receiver informs the sender about its ability to receive data.
• It is local in nature, concerning only the sender and receiver.
• It deals with the rate of data transfer between the two nodes to prevent buffer overflow or underflow.
• Examples of flow control mechanisms include stop-and-wait, sliding window, and credit-based approaches.
Congestion Control:
Congestion control, on the other hand, is a mechanism that operates at a broader network level, addressing the issue of managing traffic flow across the entire network or internet. Its
primary objective is to prevent or mitigate the occurrence of congestion, which can lead to performance degradation, packet loss, and potential network collapse.
Congestion control involves the following key aspects:
• It is a global mechanism that considers the overall network conditions and resource utilization.
• It aims to maintain the total traffic in the network below the level at which performance deteriorates significantly.
• It involves monitoring network resources and adjusting the transmission rates of sources accordingly.
• Examples of congestion control techniques include leaky bucket, token bucket, choke packets, and TCP congestion control mechanisms like Slow Start and Congestion
Avoidance.
While flow control focuses on the sender-receiver relationship and buffer management, congestion control takes a broader view, considering the entire network path and resource
availability. Effective congestion control mechanisms often rely on feedback from the network, such as packet loss or delay indicators, to detect and respond to congestion.
It's important to note that both flow control and congestion control are essential for ensuring reliable and efficient data communication in computer networks. Flow control operates
at a local level, while congestion control operates at a global level, coordinating the overall traffic flow across the network.
Computer Networks Page 4
In practice, flow control and congestion control mechanisms often work together to achieve optimal network performance. For example, in the Transmission Control Protocol (TCP),
flow control is implemented through the advertised receive window, while congestion control is achieved through mechanisms like Slow Start, Congestion Avoidance, and Fast
Retransmit/Fast Recovery.
Slow Start (a proactive technique):
Slow Start is a proactive congestion control technique used in the Transmission Control Protocol (TCP). It is designed to prevent the sudden introduction of a large amount of traffic
into the network, which could aggravate existing congestion.
Here's how Slow Start works:
1. When a new TCP connection is established, the sender is initially restricted to sending only a small amount of data, typicall y one maximum segment size (MSS).
2. For each acknowledgment (ACK) received from the receiver, the sender is allowed to increase the amount of data it can transmi t by one MSS.
3. This process continues, with the sender's congestion window (the amount of data it can transmit) increasing exponentially for each round-trip time (RTT) until a threshold is
reached or congestion is detected.
4. If congestion is detected (e.g., through packet loss or timeouts), the sender enters a congestion avoidance phase, where the congestion window is reduced and increased more
gradually to probe for available bandwidth.
The Slow Start algorithm ensures that new TCP connections do not abruptly introduce a large amount of traffic into the network, which could exacerbate existing congestion. Instead,
it gradually increases the transmission rate until it reaches an appropriate level or encounters congestion.
Slow Start is a proactive technique because it anticipates and tries to prevent congestion from occurring in the first place, rather than reacting to it after it has already happened. It is
an essential part of TCP's congestion control mechanisms and contributes to the overall stability and fairness of the Internet.
TCP congestion control
TCP congestion control refers to the mechanism that prevents congestion from happening or removes it after congestion takes place. When congestion takes place in the network,
TCP handles it by reducing the size of the sender’s window. The window size of the sender is determined by the following two factors:
• Receiver window size
• Congestion window size
Receiver Window Size
It shows how much data can a receiver receive in bytes without giving any acknowledgment.
Things to remember for receiver window size:
1. The sender should not send data greater than that of the size ofreceiver window.
2. If the data sent is greater than that of the size of the receiver’s window, then it causes retransmissionof TCP due to the dr opping of TCP segment.
3. Hence sender should always send data that is less than or equal to the size of the receiver’s window.
4. TCP header is used for sending the window size of the receiver to the sender.
Congestion Window
It is the state of TCP that limits the amount of data to be sent by the sender into the network even before receiving the acknowledgment.
Following are the things to remember for the congestion window:
1. To calculate the size of the congestion window, different variants of TCP and methods are used.
2. Only the sender knows the congestion window and its size and it is not sent over the link or network. The formula for determining the sender’s window size is:
Sender window size = Minimum (Receiver window size, Congestion window size)
1. Slow Start:
The Slow Start phase is the initial phase of TCP's congestion control algorithm. It is designed to gradually increase the transmission rate until it reaches an optimal level or encounters
congestion. The steps involved in the Slow Start phase are:
• The sender initially sets the congestion window (cwnd) to a small value, typically one maximum segment size (MSS).
• For each acknowledgment (ACK) received from the receiver, the sender increases the cwnd by one MSS.
• This process continues, resulting in an exponential increase in the congestion window until it reaches a threshold called the slow start threshold (ssthresh).
• If congestion is detected (through packet loss or timeout), the Slow Start phase ends, and the Congestion Avoidance phase beg ins.
2. Congestion Avoidance:
The Congestion Avoidance phase is designed to prevent further congestion by increasing the congestion window more gradually than in the Slow Start phase. The steps involved in the
Congestion Avoidance phase are:
• The ssthresh is set to half the current cwnd value when congestion is detected.
• The cwnd is also set to the new ssthresh value.
• For each ACK received, the cwnd is increased by 1 MSS.
• This results in a linear increase in the congestion window, allowing the sender to probe for additional available bandwidth cautiously.
• If congestion is detected again, the Congestion Avoidance phase is re-entered with updated ssthresh and cwnd values.
3. Fast Retransmit:
The Fast Retransmit phase is triggered when the sender receives duplicate ACKs from the receiver, indicating that some segments have been lost. The steps involved in the Fast
Retransmit phase are:
• If the sender receives three duplicate ACKs, it assumes that a segment has been lost.
• The sender retransmits the missing segment without waiting for a timeout.
Computer Networks Page 5
• The sender retransmits the missing segment without waiting for a timeout.
• The ssthresh is set to max(FlightSize / 2, 2 * MSS), where FlightSize is the amount of outstanding data in the network.
• The cwnd is set to the new ssthresh value plus 3 * MSS.
• The Fast Recovery phase is then entered.
4. Fast Recovery:
The Fast Recovery phase is designed to quickly recover from the detected packet loss and continue data transmission without going through the Slow Start phase again. The steps
involved in the Fast Recovery phase are:
• For each additional duplicate ACK received, the cwnd is increased by one MSS.
• This allows the sender to transmit additional data without waiting for a retransmission timeout.
• When the missing segment is acknowledged, the cwnd is set to the ssthresh value.
• The Congestion Avoidance phase is then entered.
These four phases work together to achieve reliable data transmission while adapting to network conditions and congestion. The Slow Start phase helps to probe for available
bandwidth gradually, the Congestion Avoidance phase allows for controlled growth, and the Fast Retransmit and Fast Recovery phases enable efficient recovery from packet loss.
Computer Networks Page 6