CN IMP Solution Part 1
CN IMP Solution Part 1
1. Physical Layer
3. Network Layer
● Routing: Finding the best path for data to travel across networks.
● Congestion Control: Managing data flow to avoid network congestion,
which can cause delays or data loss.
● Addressing: Assigning unique network addresses to devices for
identification and routing.
4. Transport Layer
5. Session Layer
6. Presentation Layer
7. Application Layer
1. Reliability
2. Addressing
3. Error Control
4. Flow Control
6. Scalability
7. Routing
● Definition: Finding the best path for data to travel from sender to receiver
across networks.
● Explanation: Routing works like a GPS, directing data packets through the
quickest and most efficient paths to their destination.
8. Confidentiality
● Definition: Ensuring that only authorized people can access the data.
● Explanation: Confidentiality is like locking private information in a safe so
only those with the key (authorized people) can see it.
9. Integrity
1. Bus Topology
● Structure: All devices are connected to a single central cable called the
"bus."
● Features: Simple to set up, but if the main cable fails, the entire network
goes down. Each device shares the same communication line, so only one
device can send data at a time.
2. Ring Topology
● Structure: All devices are connected to a central hub or switch. Data flows
through this central point.
● Pros: If one cable fails, it doesn’t affect the rest of the network; easy to add
new devices.
● Cons: If the central hub fails, the entire network goes down; requires more
cable than a bus topology.
4. Tree Topology
6. Hybrid Topology
1. Hub
2. Switch
3. Router
4. Repeater
6. Gateway
HLEN: Header length (4 bits), which is the number of 32-bit words in the header.
It can range from 5 to 15.
Type of Service: Specifies the priority of the packet (8 bits), such as Low Delay,
High Throughput, or Reliability.
Total Length: The total length of the header and data combined (16 bits), with a
minimum of 20 bytes and a maximum of 65,535 bytes.
Identification: A unique ID for each packet (16 bits), used to identify fragments
that belong to the same data packet.
Fragment Offset: Shows the position of the fragment within the original data
packet. It’s measured in units of 8 bytes, with a maximum value of 65,528 bytes.
Time to Live (TTL): Sets the packet's lifetime (8 bits), limiting the number of
hops a packet can take to prevent it from endlessly looping in the network.
Protocol: Specifies the protocol (8 bits) to which the data should be passed
(e.g., TCP or UDP).
Option: Optional field for additional information, like source route or record route,
often used by network administrators to verify network paths.
Q6:-Explain Classful & Classless IPv4(10m)
Define:
Classful addressing was introduced in 1981, dividing IPv4 addresses into five
classes (A to E), each with a specific range. The class of an IP address decides
how to separate the network part from the host part using a specific subnet mask
for that class. However, classful addressing was not flexible and caused
problems with how addresses were allocated. This led to the creation of
classless addressing (CIDR) to use IP address space more efficiently.
Class A
● Structure: In a Class A address, the first bit of the first octet is always '0'.
● Range: Class A addresses range from 0.0.0.0 to 127.255.255.255
(because 01111111 in binary converts to 127 in decimal).
● Network and Host Portion: The first 8 bits (or the first octet) represent the
network portion, and the remaining 24 bits (or 3 octets) represent the host
portion.
● Subnet Mask: The default subnet mask for Class A is 255.0.0.0.
● Example: 10.0.0.1 is a Class A address, where '10' represents the
network, and '0.0.1' represents the host.
Class B
● Structure: In a Class B address, the first two bits of the first octet are
always '10'.
● Range: Class B addresses range from 128.0.0.0 to 191.255.255.255
(because 10111111 in binary converts to 191 in decimal).
● Network and Host Portion: The first 16 bits (or 2 octets) represent the
network portion, and the remaining 16 bits (or 2 octets) represent the host
portion.
● Subnet Mask: The default subnet mask for Class B is 255.255.0.0.
● Example: 172.16.0.1 is a Class B address, where '172.16' represents the
network, and '0.1' represents the host.
Class C
● Structure: In a Class C address, the first three bits of the first octet are
always '110'.
● Range: Class C addresses range from 192.0.0.0 to 223.255.255.255
(because 11011111 in binary converts to 223 in decimal).
● Network and Host Portion: The first 24 bits (or 3 octets) represent the
network portion, and the last 8 bits (or 1 octet) represent the host portion.
● Subnet Mask: The default subnet mask for Class C is 255.255.255.0.
● Example: 192.168.1.1 is a Class C address, where '192.168.1' represents
the network, and '1' represents the host.
Class D
● Structure: In a Class D address, the first four bits of the first octet are
always '1110'.
● Range: Class D addresses range from 224.0.0.0 to 239.255.255.255
(because 11101111 in binary converts to 239 in decimal).
● Usage: Class D addresses are reserved for multicast, which is used to
send data to multiple devices at once.
● Subnet Mask: Class D does not use a standard subnet mask.
● Example: 224.0.0.1 is a Class D address, used for multicast.
Class E
● Structure: In a Class E address, the first four bits of the first octet are
always '1111'.
● Range: Class E addresses range from 240.0.0.0 to 255.255.255.255.
● Usage: Class E addresses are reserved for experimental purposes and
research; they are not used for general internet traffic.
● Subnet Mask: Class E does not use a standard subnet mask.
● Example: 250.1.1.1 is a Class E address, reserved for testing or
experimental use.
Q7:-Dijkstra Algorithm(10m)
Dijkstra's algorithm is a popular algorithm used to find the shortest path between
nodes in a graph.
1. Initialize:
○ Start with the source (starting) node.
○ Set the distance to the source node as 0 and all other nodes as
infinity (∞).
○ Mark all nodes as unvisited.
2. Visit the Unvisited Node with the Smallest Known Distance:
○ From the source node, select the unvisited node with the smallest
known distance.
3. Update Distances:
○ For the current node, calculate the distance to each of its
neighboring nodes.
○ If the calculated distance is smaller than the known distance, update
it.
4. Mark the Current Node as Visited:
○ Mark the current node as visited, meaning it won’t be checked again.
5. Repeat:
○ Repeat steps 2–4 until all nodes have been visited or the shortest
path to the destination node is found.
6. Construct the Shortest Path (Optional):
○ To find the shortest path, backtrack from the destination node to the
source node by following the nodes with the minimum distance
values.
7. Example of your’s
Link State Routing (LSR) is a strong and efficient routing method used in
computer networks.
● How it works: LSR uses a link state database (LSDB) to keep track of the
status of all links in the network. It then uses Dijkstra’s shortest path
algorithm to find the best route for data to travel.
● When it’s useful: LSR is particularly effective in large networks that
change frequently, as it doesn’t have the “count-to-infinity” issue found in
some other routing methods.
● Drawbacks: LSR needs more memory and processing power compared to
Distance Vector Routing (DVR) and is less scalable for extremely large
networks.
To understand the Link State Routing algorithm, here are the three main ideas:
● Quick Convergence and Adaptability: LSR only needs to know about the
links it is directly connected to, unlike Distance Vector Routing (DVR),
which needs to understand the entire network. This allows LSR to quickly
adjust to changes in the network, making it very useful in large networks
where connections change frequently.
● No Count-to-Infinity Problem: LSR does not have the “count-to-infinity”
issue found in DVR. In DVR, if two routers have incorrect distance
information to a destination, they might keep updating each other
indefinitely, causing a loop. With LSR, routers only share information about
their direct links, so this problem doesn’t occur.
RARP
This allows the device to find out its IP address without needing to remember it or
know which server will respond to the request. The server with the table of MAC
and IP addresses will respond to this request, assigning the IP address to the
device. RARP is limited in that it only assigns IP addresses, without offering other
services.
How Does RARP Work?
Disadvantages of RARP
Distance vector routing works by having each router maintain a table (or vector)
that shows the best-known distance to each destination and which link to use to
get there. Routers update these tables by exchanging information with their
neighbors, so eventually, each router knows the best path to each destination in
the network.
Another name for this algorithm is the distributed Bellman-Ford routing algorithm,
named after its inventors, and it was the original algorithm used in the ARPANET
and Internet under the name RIP (Routing Information Protocol).
In distance vector routing, each router keeps a routing table that lists every other
router in the network. Each entry in this table has two parts:
The distance can be measured in hops (the number of steps between routers) or
delay (the time it takes for data to travel between routers). The router knows the
distance to each of its neighboring routers. If the distance metric is hops, the
distance to each neighbor is just one hop. If it’s based on delay, the router
measures it directly by sending special “echo” packets that return as fast as
possible.
For example, if delay is the metric, the router measures the delay to each
neighbor. Then, every so often (for example, every T milliseconds), each router
sends its estimated delays to each destination to its neighbors and receives
similar information back.