0% found this document useful (0 votes)
13 views27 pages

Lab Manual of CN

Download as docx, pdf, or txt
Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1/ 27

LAB MANUAL

Computer Networks

Submitted by: Minha


Roll no: 21-CS-02
Submitted to: Najam Farooq
Lab no.1
Topic: What are the mediums of Physical Layer in OSI model?
Physical Layer:
A physical medium acts as the tangible highway for data in computer networks. It's the actual
material path, like cables or optical fibers, that carries electrical or optical signals representing
information. Unlike its wireless counterpart, this tangible infrastructure offers stability and
security but requires physical installation and limits mobility. Think of it as the road on which data
packets travel, ensuring the information's physical journey from one device to another, forming the
essential foundation for higher-level communication protocols to build upon.
Mediums in Physical layer:
There are two mediums in Physical layers:
 Wired medium
 Wireless medium

Wired Medium:
Wired communication media are also known as Guided media and are a type of Transmission
media. This type of communication is the most stable which is why it is considered better than
wireless. These connections are less prone to other outer interferences. In wired communication
media, wire is used to transfer data from source to destination. Wired communication media is not
better for public use but can be used for professional purposes as it more relies on wires and ports
which is not the case with wireless networks, data can be accessed from anywhere. Also, the
connection speed of wired media is more as compared to wireless. The whole setup of wired
media is also expensive as the larger the distances more no. of cables and ports would be required
and fiber optic cables are usually expensive.
Types of Wired Medium
 Twisted Pair cable:
Twisted pair cables have two conductors that are generally made up of copper and each
conductor has insulation. These two conductors are twisted together, thus giving the name
twisted pair cables.
One of the conductors is used to carry the signal and the other is used as a ground reference only.
The receiver uses the difference of signals between these two conductors. The noise or crosstalk in
the two parallel conductors is high but this is greatly reduced in twisted pair cables due to the
twisting characteristic. In the first twist, one conductor is near to noise source and the other is far
from the source but in the next twist the reverse happens and the resultant noise is very less and
hence the balance in signal quality is maintained and the receiver receives very less or no noise.
The quality of signal in twisted pair cables greatly depends upon the number of twists per unit
length of the cable.
Twisted pair cables are further of types:
 UTP
 FTP
 STP
Unshielded twisted pair (UTP):
UTP stands for Unshielded Twisted Pair. In the mantle of a UTP cable you will find eight
separate wires. All the wires are twisted in four pairs. A connector can be placed on the end of these
cables. These connectors are also known as RJ45 plugs.

How UTP cables work: Twisted pair design


Inside a UTP cable is up to four twisted pairs of copper wires enclosed in a protective plastic cover, with
the greater number of pairs corresponding to more bandwidth. The two individual wires in a single pair
are twisted around each other, and then the pairs are twisted around each other, as well. This is done to
reduce crosstalk and electromagnetic interference, each of which can degrade network performance.
Each signal on a twisted pair requires both wires.

Twisted pairs are color-coded to make it easy to identify each pair. In North America, one wire in a pair
is identified by one of five colors: blue, orange, green, brown or slate (gray). This wire is paired with a
wire from a different color group: white, red, black, yellow or violet. Typically, one wire in a pair is
solid-colored, and the second is striped with the color of its mate -- e.g., a solid blue wire would be
paired with a white-and-blue striped wire -- so they can be easily identified and matched.
Categories of UTP cables:
The five categories of UTP cable are defined by the TIA/EIA 568 standard:
 CAT3
 CAT4
 CAT5
 CAT5e
 CAT6
CAT5:
Used in Ethernet-based LANs, CAT5 contains two twisted pairs. Cat 5 cable is used in home and
business networks, providing data transmission speeds of up to 100 Mbps. The maximum recommended
length of a Cat 5 cable is 100 meters. Exceeding this length without the aid of a bridge or other network
device could cause network issues, including data packet loss and data transmission speed degradation.
Wire order in a CAT5 cable:
A Cat 5 cable contains 8 wires and has a specific wire order. If the wires are in a different order, the
cable does not work. There are two standards, T568A and T568B, for the order of the wires. Each
standard is similar in performance and does not provide an advantage over the other. However, you must
use the same wire order on each end of the Cat 5 cable.

The tables and images below display the color and order of the wires in a Cat 5 cable, for each wiring
standard.
CAT6:

A Category 6 cable (Cat 6 cable) is a type of twisted pair cable standard used specifically in
gigabit (Gb) Ethernet-based computer networks. In 2002, it was jointly defined and specified by the
Electronics Industries Association and Telecommunication Industries Association (EIA/TIA).

A Cat 6 cable is used mainly for computer networks reaching a Gb, 1000 Mbps or one Gbps of data
transfer speed (DTR) or higher. Characteristics are as follows:

 Consists of four pairs of copper wires, which are all utilized for data transfer
 Provides bandwidth of 250 MHz, speed up to 10 Gbps and may be stretched to 100 meters in length
 Provides more enhanced crosstalk and attenuation protection than its previous twisted pair cable
versions.
The Cat 6 cable is supported by Ethernet networks.

STP: Shielded twisted pair (STP) cable was originally designed by IBM for token ring networks that
include two individual wires covered with a foil shielding, which prevents electromagnetic interference,
thereby transporting data faster.
STP is similar to unshielded twisted pair (UTP); however, it contains an extra foil wrapping or copper
braid jacket to help shield the cable signals from interference. STP cables are costlier when compared to
UTP, but has the advantage of being capable of supporting higher transmission rates across longer
distances.

The additional covering in STP cable stops electromagnetic interference from


leaking out of or into the cable.

STP cables are often used in Ethernet networks, particularly fast-data-rate


Ethernets. The effectiveness of the additional covering varies according to the
substance used for the shielding, such as:

 Frequency
 Thickness
 Type of electromagnetic noise field
 Distance from the shield to the noise source
 Shield discontinuity
 Grounding practices

FTP:

The term FTP stands for foil twisted pairs. FTP networking cables often support Ethernet LAN.
The cables are designed and constructed with a twisted pair or multiple twisted pairs of cores with an
overall foil tape shield wound around the assembly. Twisting the cores together and covering with the
foil shield helps to reduce cross–talk and electromagnetic interference.
Lab no.2

Ping commands

Ping:

Ping is a network utility tool used to test the reachability of a host on an Internet Protocol (IP) network.
It measures the round-trip time for messages sent from the originating host to a destination computer and
back. Ping is typically used to:

1. Check Connectivity: Verify if a particular IP address is reachable.

2. Measure Latency: Determine the time it takes for packets to travel from one device to another
and back.

3. Troubleshoot Network Issues: Identify network problems such as packet loss, high latency, or
connectivity issues.

Ping –t

The ping -t command is used to continuously ping a target IP address or hostname until the command
is manually stopped. It is commonly used to monitor the stability and performance of a network
connection over an extended period. The command will keep sending ping requests indefinitely until
you stop it by pressing Ctrl + C.
Ping-n:

The ping -n command specifies the number of echo request packets to send to a target IP address or
hostname. This is useful for controlling the duration of the ping test.

Ping-l:

The ping -l command is used to specify the size of the echo request packet sent to the target host. This
can be useful for testing how different packet sizes affect the network's performance and identifying
issues such as fragmentation.
Ping –w

The ping -w command sets the timeout period, in milliseconds, to wait for each reply before
considering the ping attempt a failure. This can be useful for controlling how long the ping command
waits for a response, especially in environments with variable latency.
Lab no.3
MAC Layer:
The MAC (Media Access Control) layer is a sublayer of the Data Link layer in the OSI (Open
Systems Interconnection) model. It is responsible for controlling how devices on a network gain
access to the medium and permission to transmit data. The MAC layer ensures that data packets are
delivered to the correct device on a local network segment.
Key Functions of the MAC Layer
1. Addressing: The MAC layer uses MAC addresses to uniquely identify devices on a network.
Each network interface card (NIC) has a unique MAC address, which helps in directing data
packets to the correct destination.
2. Access Control: The MAC layer determines when and how devices can transmit data over the
network. It implements protocols that prevent collisions and ensure fair access to the network
medium.
3. Frame Delimiting: It defines the beginning and end of a data frame, ensuring that data is
properly framed and recognized by receiving devices.
4. Error Detection: The MAC layer can include error-detection mechanisms, such as checksums,
to detect errors in transmitted frames. It does not, however, correct these errors.
5. Media Access Methods: The MAC layer employs various methods to control access to the
shared network medium. Common methods 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.
Common MAC Layer Protocols
1. Ethernet: The most widely used LAN technology, which uses CSMA/CD for access control.
Ethernet frames include source and destination MAC addresses.
2. Wi-Fi: A wireless networking technology that uses CSMA/CA to manage access to the wireless
medium, avoiding collisions.
3. Token Ring: A network protocol where a token circulates in the network, and only the device
holding the token can transmit data. This method helps in avoiding collisions.
Mac address:
A Media Access Control (MAC) address is a unique identifier assigned to network interface
controllers (NICs) for use as a network address in communications within a network. It is a 48
bit address and is usually represented as a string of 12 hexadecimal digits separated by colons or
dashes.
How is MAC address assigned to NIC?
MAC addresses are assigned to network interface controllers (NICs) by the manufacturer during
the manufacturing process. The first three bytes of the MAC address, also known as the
Organizationally Unique Identifier (OUI), are assigned by the Institute of Electrical and
Electronics Engineers (IEEE) to the manufacturer of the NIC. The remaining three bytes are
assigned by the manufacturer, and are typically assigned in a unique and sequential manner to
each NIC they produce.
MAC address format
A Media Access Control (MAC) address is a 48-bit address that is typically represented as a
string of 12 hexadecimal digits, separated by colons or dashes. The first 24 bits (the first three
bytes) of the MAC address represent the Organizationally Unique Identifier (OUI), which
identifies the manufacturer of the network interface controller (NIC). The remaining 24 bits (the
last three bytes) of the MAC address represent the unique identifier for the NIC.
The format of a MAC address is typically represented as follows:

Ethernet:
Ethernet is a family of networking technologies and protocols used primarily for local area networks
(LANs). It defines standards for wiring and signaling, as well as data frame formats and network
access methods, allowing multiple devices to communicate within a network.
Key Features of Ethernet
1. Standardization: Ethernet is defined by the IEEE 802.3 standard, ensuring interoperability
between equipment from different manufacturers.
2. Topology: It typically uses a star or bus topology. In modern networks, star topology with
switches is the most common.
3. Speed: Ethernet has evolved over time to support increasing speeds, from the original 10
Mbps to 100 Mbps (Fast Ethernet), 1 Gbps (Gigabit Ethernet), 10 Gbps, and beyond.
4. Media: Ethernet supports various types of cabling, including twisted pair (Cat5e, Cat6,
Cat6a, etc.), coaxial, and fiber optic cables.
Evolution of Ethernet
1. 10BASE-T: The original Ethernet standard, operating at 10 Mbps over twisted-pair cables.
2. Fast Ethernet (100BASE-TX): An upgrade to 100 Mbps, also using twisted-pair cables.
3. Gigabit Ethernet (1000BASE-T): Operating at 1 Gbps, using Cat5e or higher twisted-pair
cables.
4. 10 Gigabit Ethernet (10GBASE-T): Operating at 10 Gbps, typically using Cat6a or higher
cables.
5. Beyond 10 Gbps: Standards exist for 25 Gbps, 40 Gbps, 100 Gbps, and higher, often using fiber
optics.
Ethernet Frame Format:

An Ethernet frame consists of several fields:

1. Preamble: A 7-byte pattern of alternating 1s and 0s used to synchronize the receiver's clock.
2. Start Frame Delimiter (SFD): A 1-byte field indicating the start of the frame.
3. Destination MAC Address: A 6-byte address identifying the receiving device.
4. Source MAC Address: A 6-byte address identifying the sending device.
5. EtherType/Length: A 2-byte field that either indicates the protocol encapsulated in the payload
(EtherType) or the length of the payload.
6. Payload/Data: The actual data being transmitted, ranging from 46 to 1500 bytes.
7. Frame Check Sequence (FCS): A 4-byte CRC checksum used for error detection.
Lab no.4
Network Layer:
The Network layer is the third layer of the OSI (Open Systems Interconnection) model. It is
responsible for the logical addressing and routing of data packets between devices on different
networks. This layer determines the best path for data to travel from the source to the destination,
often across multiple interconnected networks.
Key Functions of the Network Layer
1. Logical Addressing: The Network layer assigns logical addresses (IP addresses) to devices,
enabling them to be identified uniquely across different networks. This is different from physical
addressing, which uses MAC addresses.
2. Routing: The layer determines the optimal path for data packets to travel from the source to the
destination. Routers, which operate at the Network layer, use routing tables and protocols to
make these decisions.
3. Packet Forwarding: The Network layer forwards data packets from one network to another,
ensuring that they reach their intended destination. Routers perform this function by examining
the destination IP address.
4. Fragmentation and Reassembly: If a packet is too large to be transmitted over the underlying
network, the Network layer can fragment it into smaller pieces. These fragments are reassembled
at the destination.
5. Error Handling and Diagnostics: The Network layer provides mechanisms for error detection,
reporting, and diagnostics. Protocols like ICMP (Internet Control Message Protocol) are used for
this purpose.
IP addressing:
IP addressing is a system used to uniquely identify devices on a network and enable them to
communicate with each other over an Internet Protocol (IP) network. An IP address is a numerical
label assigned to each device connected to a network that uses the IP for communication.
Structure of an IP Address
An IP address consists of two parts:
1. Network Part: Identifies the network to which the device belongs.
2. Host Part: Identifies the specific device on that network.
Types of IP Addressing
1. Static IP Addressing: A permanent IP address assigned to a device. Useful for servers, network
devices, and other critical infrastructure that needs consistent addressing.
2. Dynamic IP Addressing: An IP address assigned by a DHCP (Dynamic Host Configuration
Protocol) server, which can change each time the device connects to the network. Commonly
used for client devices like laptops, smartphones, and home computers.
IPv4:

IPv4 addresses are divided into five classes, designated A, B, C, D, and E.


Key Features of IPv4
1. Address Format: IPv4 addresses are 32-bit numbers, typically represented in decimal format as
four 8-bit fields separated by dots (e.g., 192.168.0.1). Each field can range from 0 to 255.
2. Address Space: IPv4 provides approximately 4.3 billion unique addresses (2^32). Due to the
exponential growth of internet-connected devices, this address space is nearly exhausted.
3. Subnetting: IPv4 supports subnetting, which allows a single IP address range to be divided into
smaller segments or subnets, facilitating efficient address allocation and network management.
4. Routing: IPv4 uses routing protocols to determine the best path for data to travel across
interconnected networks. Examples include OSPF (Open Shortest Path First) and BGP (Border
Gateway Protocol).
IPv4 Header:
Lab no.5
Network Layer:
The Network layer is the third layer of the OSI model responsible for logical addressing and routing of
data packets across different networks. It determines the best path for data to travel from the source to
the destination, ensuring efficient and reliable communication.
Classes:
 Class A:

 Range: 0.0.0.0 to 127.255.255.255


 Leading bit: 0
 Default subnet mask: 255.0.0.0
 Suitable for very large networks (e.g., large corporations).

 Class B:

 Range: 128.0.0.0 to 191.255.255.255


 Leading bits: 10
 Default subnet mask: 255.255.0.0
 Suitable for medium-sized networks (e.g., universities).

 Class C:

 Range: 192.0.0.0 to 223.255.255.255


 Leading bits: 110
 Default subnet mask: 255.255.255.0
 Suitable for small networks (e.g., small businesses).

 Class D:

 Range: 224.0.0.0 to 239.255.255.255


 Leading bits: 1110
 Used for multicast groups.

 Class E:

 Range: 240.0.0.0 to 255.255.255.255


 Leading bits: 1111
 Reserved for experimental purposes.

Subnetting:
Subnetting is the process of creating a subnetwork (also known as a subnet) within a network. Network
interfaces and devices within a subnet can communicate with each other directly. Routers facilitate
communication between different subnets.
How to create a subnet
A subnet contains three main elements:
1. Network address (or) subnet ID: This is always the first address of the subnet.
2. Broadcast address: This is always the last address of the subnet. A packet forwarded to the
broadcast address is broadcasted to all the addresses in a subnet.
3. Subnet mask (or) netmask: This is the bitmask used to identify the subnet of an IP address by
applying bitwise AND operation with the netmask and the IP address. All the IP addresses in a
subnet contain an identical most-significant bit group. This is how a router identifies the subnet
of an IP address since data packets only contain the destination IP address.
Benefits of subnetting
Subnetting offers three common benefits:
 Improved Network Performance: When a device broadcasts a packet, it’ll reach all the
network devices, burdening the network. Without proper context, broadcast packets can also
spam devices within the network. This can lead to degraded network performance. By
creating subnets, you can limit the scope of intranetwork broadcast messages to a specific
subnet. This also enables efficient communication between devices in a subnet and sends a
packet for routing outside the subnet if a destination address isn’t part of the subnet, leading
to minimum network congestion.
 Enhanced Network Security: If an attacker gains unauthorized access to your network, all
your network devices may be compromised. With subnets, you can limit a network breach by
isolating the compromised subnetwork.
 Simplified Network Management: IPv4 host addresses are classified into three classes:
Class A, Class B, and Class C.
A. Each Class A block contains 16,777,214 addresses.

B. Each Class B block contains 65,534 addresses.

C. Each Class C block contains 254 addresses.


If your organization requires more than 254 host addresses, then a Class B allocation would be
necessary. Without subnetting, this may waste huge amounts of addresses.

In addition, subnetting simplifies network monitoring and management by helping you logically
group network devices.

Lab no.6
NAT:
Network Address Translation (NAT) is a service that enables private IP networks to use the
internet and cloud. NAT translates private IP addresses in an internal network to a public IP
address before packets are sent to an external network.
Network Address Translation (NAT) working :
Generally, the border router is configured for NAT i.e the router which has one interface in the
local (inside) network and one interface in the global (outside) network. When a packet traverse
outside the local (inside) network, then NAT converts that local (private) IP address to a global
(public) IP address. When a packet enters the local network, the global (public) IP address is
converted to a local (private) IP address.
If NAT runs out of addresses, i.e., no address is left in the pool configured then the packets will
be dropped and an Internet Control Message Protocol (ICMP) host unreachable packet to the
destination is sent.
NAT inside and outside addresses
Inside refers to the addresses which must be translated. Outside refers to the addresses which
are not in control of an organization. These are the network Addresses in which the
translation of the addresses will be done.

 Inside local address – An IP address that is assigned to a host on the Inside (local) network. The
address is probably not an IP address assigned by the service provider i.e., these are private IP
addresses. This is the inside host seen from the inside network.

 Inside global address – IP address that represents one or more inside local IP addresses to the
outside world. This is the inside host as seen from the outside network.

 Outside local address – This is the actual IP address of the destination host in the local network
after translation.

 Outside global address – This is the outside host as seen from the outside network. It is the IP
address of the outside destination host before translation.
Advantages of NAT
 NAT conserves legally registered IP addresses.
 It provides privacy as the device’s IP address, sending and receiving the traffic, will be hidden.
 Eliminates address renumbering when a network evolves.

CIDR:
Classless Inter-Domain Routing (CIDR) is a method of IP address allocation and IP routing that
allows for more efficient use of IP addresses. CIDR is based on the idea that IP addresses can be
allocated and routed based on their network prefix rather than their class, which was the traditional
way of IP address allocation.
CIDR addresses are represented using a slash notation, which specifies the number of bits in the
network prefix. For example, an IP address of 192.168.1.0 with a prefix length of 24 would be
represented as 192.168.1.0/24. This notation indicates that the first 24 bits of the IP address are the
network prefix and the remaining 8 bits are the host identifier.
Properties of CIDR Block
The properties of CIDR block are as follows :
 The IP addresses in a block are continuous.
 The first address of a block should be exactly divisible by the number of addresses of a
block.
 The size of the Block should be power of 2.

Use of CIDR
 Variable-length subnet masking is the foundation of CIDR (VLSM). It can now specify
prefixes of any duration, making it much more powerful than the previous method.
 Two collections of numbers make up CIDR IP addresses. The network address is written as a
prefix, similar to how an IP address is written (e.g. 192.255.255.255).
 The suffix, which means how many bits are in the whole address (e.g. /12), is the second
component. A CIDR IP address will look anything like this when put together −
 192.255.255.255/12
 As part of the IP address, the network prefix is also defined. These changes are based on how
many bits are needed. As an illustration, in the above example, the first 12 bits of the address
are for the network, while the last 20 bits are for host addresses.
CIDR Notation
Using CIDR we can assign an IP address to host without using standard id address classes
like Class A, B, and C.
In CIDR we simply tell how many bits are used for network id. The network id bits are
provided after the '/' symbol. Like /10 means 10 bits are used for the network id part and
remaining 32-10=22 bits are used for the host id part.

The advantage of using CIDR notation is that it reduces the number of entries in the routing
table and also it manages the ip address space.
DHCP:
Dynamic Host Configuration Protocol is a network protocol used to automate the process of
assigning IP addresses and other network configuration parameters to devices (such as
computers, smartphones, and printers) on a network. Instead of manually configuring each
device with an IP address, DHCP allows devices to connect to a network and receive all
necessary network information, like IP address, subnet mask, default gateway, and DNS server
addresses, automatically from a DHCP server.
Working of DHCP:
DHCP works on the Application layer of the TCP/IP Protocol. The main task of DHCP is to
dynamically assigns IP Addresses to the Clients and allocate information on TCP/IP
configuration to Clients.The DHCP port number for the server is 67 and for the client is 68. It
is a client-server protocol that uses UDP services. An IP address is assigned from a pool of
addresses. In DHCP, the client and the server exchange mainly 4 DHCP messages in order to
make a connection, also called the DORA process, but there are 8 DHCP messages in the
process.

Advantages
 Centralized management of IP addresses.
 Centralized and automated TCP/IP configuration.
 Ease of adding new clients to a network.
 Reuse of IP addresses reduces the total number of IP addresses that are required.
 The efficient handling of IP address changes for clients that must be updated frequently, such as
those for portable devices that move to different locations on a wireless network.
 Simple reconfiguration of the IP address space on the DHCP server without needing to
reconfigure each client.
 The DHCP protocol gives the network administrator a method to configure the network from a
centralized area.
 With the help of DHCP, easy handling of new users and the reuse of IP addresses can be
achieved.
Lab no.7
RIP:

Lab no.8
OSPF:

Lab no.9
EGRIP:

Lab no.10
Transport Layer:
The Transport layer is the fourth layer of the OSI (Open Systems Interconnection) model. It is
responsible for providing end-to-end communication services for applications within a layered
architecture of network components and protocols. The main functions of the Transport layer
include ensuring complete data transfer, error recovery, and flow control.
Key Functions of the Transport Layer
Segmentation and Reassembly:
The Transport layer breaks down large data streams into smaller segments for easier
handling by the Network layer. It also reassembles these segments into the original data
stream at the receiving end.
Error Detection and Correction:
It provides mechanisms to detect and correct errors that may occur during data
transmission, ensuring data integrity and reliability.
Flow Control:
It manages the rate of data transmission between two nodes to prevent a fast sender from
overwhelming a slow receiver. This ensures efficient and stable communication.
Connection Establishment and Termination:
The Transport layer establishes, maintains, and terminates connections between
communicating devices. This involves setting up a session, maintaining the session, and
tearing it down once communication is complete.
Multiplexing and Demultiplexing:
It allows multiple applications to use the network simultaneously by assigning unique
port numbers to different applications. This ensures that data meant for a specific
application is correctly delivered.
Reliability:
It ensures reliable data transfer by implementing mechanisms like acknowledgments
(ACKs), retransmissions of lost packets, and sequencing of data segments.
Key Protocols of the Transport Layer
Transmission Control Protocol (TCP):
Characteristics: Connection-oriented, reliable, provides error checking, flow control, and
congestion control.
Use Cases: Used for applications requiring reliable communication, such as web browsing
(HTTP/HTTPS), email (SMTP), and file transfers (FTP).
User Datagram Protocol (UDP):
Characteristics: Connectionless, faster but less reliable, minimal error checking, no flow control.
Use Cases: Used for applications where speed is crucial and occasional loss of data is
acceptable, such as streaming media, online gaming, and VoIP (Voice over IP).

Tcp header Frame Format:


Lab no.11
UDP header frame format:

 Source port number


 This field identifies the sender's port, when used, and should be assumed to be the port to reply to if
needed. If not used, it should be zero. If the source host is the client, the port number is likely to be
an ephemeral port. If the source host is the server, the port number is likely to be a well-known
port number from 0 to 1023.
 Destination port number
 This field identifies the receiver's port and is required. Similar to source port number, if the client is
the destination host then the port number will likely be an ephemeral port number and if the
destination host is the server then the port number will likely be a well-known port number.
 Length
 This field specifies the length in bytes of the UDP header and UDP data. The minimum length is 8
bytes, the length of the header. The field size sets a theoretical limit of 65,535 bytes (8-byte header +
65,527 bytes of data) for a UDP datagram. However, the actual limit for the data length, which is
imposed by the underlying IPv4 protocol, is 65,507 bytes (65,535 bytes − 8-byte UDP header − 20-
byte IP header).
 Using IPv6 jumbograms it is possible to have UDP datagrams of size greater than 65,535 bytes. The
length field is set to zero if the length of the UDP header plus UDP data is greater than 65,535.
 Checksum
 The checksum field may be used for error-checking of the header and data. This field is optional in
IPv4, and mandatory in most cases in IPv6.The field carries all-zeros if unused.

Lab no.12
Application Layer:
 The Application layer is the seventh and topmost layer of the OSI (Open Systems Interconnection)
model. It provides the interface between the network services and the end-user applications. This
layer facilitates communication between software applications and lower-layer network services to
enable data exchange across networks.
 Key Functions of the Application Layer
1. Network Virtual Terminal: Provides a software version of a physical terminal, allowing a user
to log on to a remote host.
2. File Transfer, Access, and Management (FTAM): Enables users to access files on a remote
host, retrieve and manage files, and execute file operations.
3. Mail Services: Facilitates email forwarding and storage, supporting applications like email
clients.
4. Directory Services: Provides distributed database sources and access for global information
about various objects and services.
5. User Authentication: Ensures that only authorized users can access certain services or data.
 Key Protocols of the Application Layer
1. Hypertext Transfer Protocol (HTTP):
o Purpose: Used for transferring web pages on the World Wide Web.
o Use Cases: Web browsing and web-based applications.
o Port Number: 80 (HTTP) and 443 (HTTPS for secure communication).
2. File Transfer Protocol (FTP):
o Purpose: Used for transferring files between a client and a server.
o Use Cases: Uploading and downloading files from servers.
o Port Number: 21 for control (commands) and 20 for data transfer.
3. Simple Mail Transfer Protocol (SMTP):
o Purpose: Used for sending emails from a client to a server or between servers.
o Use Cases: Email sending and routing.
o Port Number: 25.
4. Post Office Protocol (POP3):
o Purpose: Used by email clients to retrieve emails from a server.
o Use Cases: Email retrieval.
o Port Number: 110.
5. Internet Message Access Protocol (IMAP):
o Purpose: Allows email clients to access and manage emails on a server.
o Use Cases: Email retrieval and management.
o Port Number: 143.
6. Domain Name System (DNS):
o Purpose: Translates human-readable domain names (e.g., www.example.com) into IP
addresses.
o Use Cases: Resolving domain names to IP addresses.
o Port Number: 53.
7. Dynamic Host Configuration Protocol (DHCP):
o Purpose: Automatically assigns IP addresses to devices on a network.
o Use Cases: IP address allocation.
o Port Number: 67 (server) and 68 (client).
8. Telnet:
o Purpose: Provides a command-line interface for remote access to a server.
o Use Cases: Remote server management.
o Port Number: 23.
9. Secure Shell (SSH):
o Purpose: Provides a secure channel over an unsecured network for remote access and
management.
o Use Cases: Secure remote login and command execution.
o Port Number: 22.
Importance of the Application Layer
User Interaction: Provides the interface through which users interact with network services.
Service Integration: Integrates various network services to support end-user applications.
Data Exchange: Facilitates the exchange of data between different software applications over the
network.
Security: Implements protocols to ensure secure data transmission and user authentication.

You might also like