Networking Protocols and Concepts
Notes 1 – 1
(a) Maximum Capacity of Datagram in Internet Protocol
The maximum capacity of an IP datagram is 65,535 bytes, which includes both the header and the data. This size is determined by the 16-bit “Total Length” field in the IP header.
Deletion of IP Datagrams: IP datagrams are deleted when their “Time to Live” (TTL) value reaches zero. TTL is reduced by one at each hop, and when it reaches zero, the router discards the packet to prevent infinite looping in the network.
(b) Socket and Differences Between Active and Passive Sockets
A socket is an endpoint for sending or receiving data across a network. It is the interface between the application layer and the transport layer protocols.
Active Socket: Used by clients to initiate communication with a server.
Passive Socket: Used by servers to listen for incoming connections and accept them.
(c) ARP vs RARP
ARP (Address Resolution Protocol): Resolves IP addresses to MAC addresses for sending data on a local network.
RARP (Reverse Address Resolution Protocol): Resolves MAC addresses to IP addresses, commonly used for devices without disk drives to obtain an IP address during boot.
(d) TCP Handling of Out-of-Order Segments
TCP uses sequence numbers to identify the order of segments. If segments arrive out of order, TCP buffers them temporarily and reassembles them correctly before delivering them to the application layer.
(e) Significance of “Time to Live” (TTL)
TTL is a value in the IP header that determines the lifespan of a packet in the network. It ensures packets do not circulate indefinitely, reducing network congestion. Each router decreases TTL by 1; when TTL reaches zero, the packet is discarded.
Notes 1 – 3
(a) Byte Ordering and Functions
Byte ordering determines the sequence in which bytes are arranged in multi-byte data.
- htons: Converts a 16-bit integer from host to network byte order.
- htonl: Converts a 32-bit integer from host to network byte order.
- ntohs: Converts a 16-bit integer from network to host byte order.
- ntohl: Converts a 32-bit integer from network to host byte order.
Example: Converting an integer 12345 to network order using htons(12345) ensures compatibility across systems.
(b) IP Header Analysis
Given header: 010001010110101xx
Header Size: 20 bytes (5 * 4 bytes; IHL = 5).
Options: No (IHL = 5).
Precedence: Routine (binary 000).
Type of Service: Normal service.
(a) Syntax and Uses of “useradd” Command
Syntax: useradd [options] username
Example: useradd -m -s /bin/bash newuser
- -m: Creates a home directory for the user.
- -s: Specifies the user’s login shell.
(b) Algorithm for TCP Client and Server
TCP Server Algorithm:
- Create a socket using
socket()
. - Bind the socket to a port using
bind()
. - Listen for connections using
listen()
. - Accept a connection using
accept()
. - Send the system date and time using
send()
. - Receive acknowledgment using
recv()
. - Close the connection using
close()
.
TCP Client Algorithm:
- Create a socket using
socket()
. - Connect to the server using
connect()
. - Send a connection request.
- Receive system date and time using
recv()
. - Send acknowledgment using
send()
. - Close the connection using
close()
.
Notes 2 – 1
(a) Port Addresses at Transport Layer
Port addresses do not need to be globally unique; they only need to be unique on a given host at a specific time. This ensures multiple applications can operate simultaneously. Port addresses are shorter (16 bits) than IP addresses (32 or 128 bits) because they only differentiate services on a host, not across networks.
(b) What is ARP?
Address Resolution Protocol (ARP) maps IP addresses to MAC addresses within a local network.
Differences:
- RARP (Reverse ARP): Maps MAC addresses to IP addresses.
- BOOTP: A predecessor to DHCP, BOOTP assigns IP addresses along with other configuration details like gateway and subnet.
(c) Congestion Control Field in IP Header
The “Type of Service” (ToS) field in the IP header is used for congestion control. It prioritizes packets based on delay, throughput, reliability, and cost.
(d) DNS Block Diagram and Fields
The block diagram of DNS consists of components like root servers, TLD servers, authoritative servers, and resolvers.
DNS Message Fields: Query ID, Flags, Question, Answer, Authority, and Additional Records. These fields facilitate resolving domain names to IP addresses.
(e) MIME in Email
Multipurpose Internet Mail Extensions (MIME) expands the capabilities of email by allowing the transfer of multimedia content such as images, audio, and attachments.
(f) TCP Checksum Calculation
The checksum in the TCP header is calculated by summing the binary values of the header and data segments. Example:
Data: 10101010, Header: 11001100 → Sum: 101110110 → Checksum: 010001001 (1’s complement).
Notes 2 – 3
(a) TCP Header Size and Connection Setup
The TCP header size is typically 20 bytes. Setting up a TCP connection involves three packets: SYN, SYN-ACK, and ACK (three-way handshake).
(b) IP Address Classification
- 2.200.100.100: Class A
- 130.10.120.240: Class B
- 196.10.10.2: Class C
- 208.10.18.203: Class C
(c) Syntax of System Calls
accept()
:int accept(int sockfd, struct sockaddr *addr, socklen_t *addrlen)
listen()
:int listen(int sockfd, int backlog)
send()
:ssize_t send(int sockfd, const void *buf, size_t len, int flags)
shutdown()
:int shutdown(int sockfd, int how)
Short Notes
(a) Network Monitoring Tools
Tools like Wireshark and Nagios analyze and monitor network traffic, detect issues, and ensure performance.
(b) FreeNX
A remote desktop solution enabling secure and fast connections to a desktop environment.
(c) Cloud Computing
Delivers on-demand computing resources over the internet, enabling scalability, flexibility, and cost savings.
(d) Name Servers
DNS servers that resolve domain names into IP addresses, forming the backbone of internet navigation.
Notes 3 – 1
(a) Subnetting with Mask 255.255.0.0
A subnet mask of 255.255.0.0 allows for 2^16 – 2 = 65,534 hosts per subnet (subtracting 2 for network and broadcast addresses). The number of subnets is determined by borrowing bits from the host portion, which depends on the specific implementation.
(b) Handling Out-of-Order Segments in TCP
TCP uses sequence numbers to reassemble segments in the correct order. Out-of-order segments are buffered until missing segments arrive. Example diagram:
Segment 1 (seq: 1)
Segment 3 (seq: 3) → Buffered
Segment 2 (seq: 2) → Delivered in order.
(c) HLEN Field in IP Datagram
HLEN specifies the header length in 32-bit words. For a 20-byte option field, HLEN = (20 + 20) / 4 = 10.
(d) Distance Vector Routing Algorithm
This algorithm calculates the shortest path to every network node. Nodes exchange vector tables periodically. Example:
Node A: Distance to B is 1, to C is 3.
Updates propagate changes dynamically.
(e) ARP and RARP
ARP: Maps IP to MAC addresses. Example: Host A requests MAC of Host B via broadcast; Host B replies.
RARP: Maps MAC to IP, used for diskless devices.
(f) Importance of ICMP
ICMP reports errors like destination unreachable, time exceeded, and echo requests (ping). It ensures reliable communication at the network layer.
TCP Client and Server Algorithms
Client:
- Create socket.
- Connect to server.
- Send list of numbers.
- Receive smallest number and close.
Notes 3 – 3
DHCP Activities
- Discovery: The client broadcasts a DHCPDISCOVER message to locate DHCP servers on the network.
- Offer: The server responds with a DHCPOFFER, offering an IP address and other configuration details.
- Request: The client sends a DHCPREQUEST message to request the offered IP address.
- Acknowledgement: The server confirms the assignment by sending a DHCPACK, completing the IP address lease process.
Differences
htons vs ntohs:
- htons (Host to Network Short): Converts a 16-bit number from host byte order to network byte order.
- ntohs (Network to Host Short): Converts a 16-bit number from network byte order to host byte order.
Supernet vs Subnet:
- Supernet: A supernet combines multiple smaller networks into one larger network using CIDR (Classless Inter-Domain Routing) notation. It reduces routing table size by aggregating IP addresses.
- Subnet: A subnet divides a larger network into smaller, more manageable sections, optimizing IP address allocation and enhancing security and performance.
read vs write System Calls:
read()
: Reads data from a file descriptor, typically used to retrieve data from a file or socket.write()
: Writes data to a file descriptor, commonly used to send data to files or send responses over a network.
Broadcasting vs Multicasting:
- Broadcasting: Broadcasting sends data to all devices on a network, which can lead to congestion if overused.
- Multicasting: Multicasting sends data to a specific group of devices that are part of a multicast group, improving efficiency by only delivering the data to interested recipients.
Notes 1 – 4
Short Notes
(a) DHCP
Dynamic Host Configuration Protocol automatically assigns IP addresses and configuration details (e.g., subnet mask, default gateway) to devices in a network.
(b) VPN
Virtual Private Network provides secure, encrypted communication over a public network, allowing remote access to private networks.
(c) HTTP
HyperText Transfer Protocol is a stateless protocol used for transferring web pages, resources, and data between clients and servers.
(d) Voice over IP
Voice over IP enables voice communication over IP networks by converting voice signals into digital data packets, facilitating cheaper and flexible communication.
Notes 1 – 2
(f) Components of a URL
Example: https://www.example.com:8080/path/file.html?query=abc#section
- Protocol: https (defines how data is transferred).
- Host: www.example.com (identifies the server).
- Port: 8080 (optional, specifies the communication endpoint).
- Path: /path/file.html (specifies the resource location).
- Query: ?query=abc (provides parameters for the request).
- Fragment: #section (points to a specific section in the resource).
(g) Lost Acknowledgement and TCP Retransmission
TCP uses cumulative acknowledgments. A lost ACK does not necessarily force retransmission because subsequent acknowledgments may confirm the receipt of the missing data.
(h) Remote Login Process in TELNET
TELNET enables a user to remotely access a computer over a TCP connection. The client sends commands to the server, which executes them and returns the output. Communication occurs in plain text, making it less secure compared to modern alternatives like SSH.
(i) Reserve Bit Pattern of Class D Address
The first byte of a Class D IP address (used for multicast) starts with the bit pattern 1110.
(a) Flow Control in TCP and Sliding Window Protocol
Flow control ensures that a sender does not overwhelm the receiver with more data than it can process. The Sliding Window Protocol adjusts the window size dynamically, allowing efficient data transmission.
Example: If the window size is 5, the sender transmits up to 5 packets and waits for acknowledgments before sending more.
(b) Purpose of TCP and IP Fields
- Urgent Pointer: Identifies priority data that should be processed immediately.
- Window Size: Indicates how much data the receiver can accept without acknowledgment.
- Sequence Number: Specifies the order of transmitted data segments.
- Fragment Offset: Indicates the position of a fragment within the original datagram.
Notes 2 – 4
Notes 2 – 2
(g) Layering in TCP/IP Stack
Layering simplifies design, troubleshooting, and communication by dividing tasks into independent layers such as application, transport, network, and link.
(h) FAT 16 vs. FAT 32
- FAT16: Supports smaller disk sizes and fewer files. Maximum file size is 2GB.
- FAT32: Supports larger disks and files. Maximum file size is 4GB.
(a) Header Fields of TCP and IP
- Protocol: Identifies the transport layer protocol (e.g., TCP, UDP).
- Sequence Number: Orders data segments for reassembly.
- Version: Specifies the IP version (e.g., IPv4, IPv6).
- Type of Service: Indicates packet priority and handling.
(b) Purpose of Byte Ordering
Byte ordering ensures compatibility between systems using different architectures. Functions:
- htons, htonl (host to network).
- ntohs, ntohl (network to host).
Algorithm for UDP Client and Server
UDP Client:
- Create socket.
- Prompt user for two numbers.
- Send numbers to server.
- Receive largest number from server.
UDP Server:
- Create socket and bind to port.
- Wait for client requests.
- Receive numbers, calculate largest, and send back.
- Handle multiple clients concurrently using threads or multiprocessing.
Notes 3 – 4
Notes 3 – 2 – Server : –
The server setup involves creating a socket, binding it to a specific port, and listening for incoming client connections. Once a client connects, the server receives numbers, determines the smallest number from the received data, and sends this back to the client. The server is designed to handle up to three client connections concurrently using threads, allowing it to process multiple requests in parallel and improve overall efficiency. Each client is assigned a separate thread, ensuring that the server does not block while waiting for one client’s response.
DNS Server Working
Recursive DNS Resolution: In recursive resolution, the DNS server takes full responsibility for resolving a domain name. If it doesn’t have the answer in its cache, it queries other DNS servers, starting from the root, moving through TLD (Top-Level Domain) servers, and ultimately to the authoritative DNS server, which provides the IP address.
Iterative DNS Resolution: In iterative resolution, the DNS server does not fully resolve the query but instead refers the client to other servers. The client must then query those servers in turn until it receives the final resolution. The server’s role is only to provide a referral to the next step in the resolution process.
SNMP Security Levels
- NoAuthNoPriv: This security level offers no authentication or encryption, leaving the communication between the SNMP manager and agent unprotected.
- AuthNoPriv: Authentication is provided at this level, ensuring that the request is from an authorized user, but no encryption is applied to the data being transferred.
- AuthPriv: This highest security level provides both authentication and encryption, ensuring both the authenticity of the request and the confidentiality of the data exchanged.
Remote Network Administration Tools
- SSH (Secure Shell): SSH is a cryptographic network protocol used to securely log into remote systems over an unsecured network, ensuring encrypted communication.
- RDP (Remote Desktop Protocol): RDP allows users to access Windows desktops remotely, providing a graphical interface to interact with a remote system as if sitting right in front of it.
- VNC (Virtual Network Computing): VNC is a graphical desktop sharing system that allows users to view and interact with a desktop environment from a remote location.