OSI Model The Open Systems Interconnection (OSI) model is a conceptual framework that standardizes the functions of a telecommunication or computing system into seven distinct layers. 7. Application Layer: Provides network services to end-user applications (e.g., HTTP, FTP, SMTP). 6. Presentation Layer: Handles data translation, encryption, decryption, and compression (e.g., JPEG, MPEG). 5. Session Layer: Manages sessions between applications, establishing, managing, and terminating connections. 4. Transport Layer: Provides reliable data transfer between end-systems; handles segmentation, flow control, and error control (e.g., TCP, UDP). 3. Network Layer: Responsible for logical addressing and routing of packets across networks (e.g., IP, ICMP). 2. Data Link Layer: Provides reliable data transfer across a physical link; handles MAC addressing, error detection, and flow control (e.g., Ethernet, PPP). 1. Physical Layer: Deals with the physical transmission of raw bit streams over a physical medium (e.g., cables, connectors, voltage levels). IPv4 Address Classes IPv4 addresses are 32-bit numerical labels assigned to devices in a network. They are divided into classes based on the first few bits, determining the network and host portions. Class First Bit(s) Network Bits Host Bits Range Use A $0$ $8$ $24$ $1.0.0.0 - 126.255.255.255$ Large networks B $10$ $16$ $16$ $128.0.0.0 - 191.255.255.255$ Medium-sized networks C $110$ $24$ $8$ $192.0.0.0 - 223.255.255.255$ Small networks D $1110$ N/A N/A $224.0.0.0 - 239.255.255.255$ Multicasting E $1111$ N/A N/A $240.0.0.0 - 255.255.255.255$ Experimental/Reserved IPv4 vs. IPv6 IPv6 was introduced primarily to address the exhaustion of IPv4 addresses and to offer improvements in routing, security, and auto-configuration. Feature IPv4 IPv6 Address Length 32 bits 128 bits Address Format Decimal, dot-separated Hexadecimal, colon-separated No. of Addresses $2^{32}$ $2^{128}$ Security (IPsec) Optional Mandatory built-in Checksum Included Not included (handled by lower layers) Fragmentation Routers & sending host Only sending host Configuration Manual or DHCP Stateless Auto-configuration (SLAAC) or DHCPv6 Header Size 20-60 bytes Fixed 40 bytes IPv6 Advantages & Limitations over IPv4 Advantages: Vast address space, improved routing efficiency due to simplified header, enhanced security (IPsec built-in), better support for mobile devices, auto-configuration. Limitations: Transition complexity (IPv4-IPv6 coexistence), lack of universal backward compatibility, increased header size (though often offset by efficiency), slower adoption rate. Address Resolution Protocol (ARP) Definition: ARP is a protocol used to map an IP address to a physical MAC address on a local area network (LAN). How it works: A host (Sender) wants to send data to another host (Receiver) on the same LAN but only knows the Receiver's IP address. The Sender checks its ARP cache. If the MAC address is found, it uses it. If not found, the Sender broadcasts an ARP Request packet to all devices on the LAN. This packet contains the Sender's IP and MAC, and the Receiver's IP. All devices on the LAN receive the ARP Request. Only the Receiver whose IP matches the request replies. The Receiver sends an ARP Reply packet directly to the Sender. This packet contains the Receiver's IP and MAC address. The Sender receives the ARP Reply, updates its ARP cache with the Receiver's MAC address, and can now send data directly to the Receiver. Example: Host A (IP: $192.168.1.10$, MAC: AAAA) wants to send data to Host B (IP: $192.168.1.20$, MAC: BBBB). Host A checks ARP cache, no entry for $192.168.1.20$. Host A broadcasts ARP Request: "Who has $192.168.1.20$? Tell $192.168.1.10$ (AAAA)". Host B receives the request and replies: "I am $192.168.1.20$ (BBBB)". Host A receives the reply, adds entry "$192.168.1.20 \rightarrow$ BBBB" to its cache, and sends data to BBBB. ICMPv4 vs. ICMPv6 Internet Control Message Protocol (ICMP) is used for sending error messages and operational information indicating, for example, that a requested service is not available or that a host or router could not be reached. Feature ICMPv4 ICMPv6 (ICMP for IPv6) Associated IP IPv4 IPv6 Purpose Error reporting, diagnostics Error reporting, diagnostics, Neighbor Discovery, Multicast Listener Discovery Key Messages Echo Request/Reply (ping), Destination Unreachable, Time Exceeded, Redirect Echo Request/Reply, Destination Unreachable, Packet Too Big, Time Exceeded, Parameter Problem, Router Solicitation/Advertisement, Neighbor Solicitation/Advertisement, Multicast Listener Query/Report/Done ARP equivalent Separate ARP protocol Integrated into Neighbor Discovery Protocol (NDP) via Neighbor Solicitation/Advertisement messages IGMP equivalent Separate IGMP protocol Integrated into Multicast Listener Discovery (MLD) messages Routing Protocols Definition: A routing protocol is a set of rules used by routers to dynamically determine the best path for data packets to travel from a source to a destination across a network. Static vs. Dynamic Routing Feature Static Routing Dynamic Routing Configuration Manual by administrator Automatic by protocol Adaptability No (fixed paths) Yes (adapts to network changes) Complexity Simple for small networks Complex, requires more processing Security More secure (no routing updates) Less secure (routing updates can be intercepted) Overhead Low Higher (exchanges routing tables) Examples Manually configured routes RIP, OSPF, EIGRP, BGP Routing Information Protocol (RIP) Functioning: RIP is a distance-vector routing protocol that uses hop count as its metric to find the best path between source and destination networks. Routers running RIP exchange their entire routing tables with directly connected neighbors every 30 seconds. When a router receives a routing table from a neighbor, it updates its own table if: It discovers a new network. It finds a shorter path to an existing network (lower hop count). The maximum hop count allowed is 15; a hop count of 16 indicates an unreachable network, preventing routing loops in larger networks. How RIP decides the best route: RIP considers the route with the fewest hop counts to the destination as the "best" route. Each router traversed counts as one hop. Mobile IP Definition: Mobile IP is an Internet Engineering Task Force (IETF) standard communications protocol that allows mobile computer users to move from one network to another while maintaining their permanent IP address. It enables transparent roaming for IP devices by decoupling the identity of a device (its home IP address) from its location (its care-of address). Pros and Cons of Mobile IP Pros: Seamless Roaming: Maintains continuous connectivity and ongoing sessions (e.g., TCP connections) even when changing network access points. Location Transparency: Applications can continue to use the same IP address regardless of the device's physical location. Standardized: An IETF standard, promoting interoperability. Cons: Triangle Routing: Data often travels from the correspondent host to the home agent, then to the mobile host, which can introduce latency and inefficiency. Security Concerns: Requires secure registration and authentication between the mobile host, home agent, and foreign agent. Overhead: Adds overhead due to encapsulation and signaling messages. Complexity: Adds complexity to network infrastructure with the need for home agents and foreign agents.