Content-Length: 3117368 | pFad | https://www.scribd.com/document/456114796/CN-unit3-part1-docx
3What Is Network Layer?
What Is Network Layer?
What Is Network Layer?
The network layer is concerned with getting packets from the source all the way to
the destination. The packets may require to make many hops at the intermediate
routers while reaching the destination. This is the lowest layer that deals with end
to end transmission. In order to achieve its goals, the network layer must know
about the topology of the communication network. It must also take care to choose
routes to avoid overloading of some of the communication lines while leaving
others idle. The network layer-transport layer interface frequently is the interface
between the carrier and the customer, that is the boundary of the subnet. The
functions of this layer include :
1. Routing - The process of transferring packets received from the Data Link
Layer of the source network to the Data Link Layer of the correct
destination network is called routing. Involves decision making at each
intermediate node on where to send the packet next so that it eventually
reaches its destination. The node which makes this choice is called a router.
For routing we require some mode of addressing which is recognized by the
Network Layer. This addressing is different from the MAC layer addressing.
2. Inter-networking - The network layer is the same across all physical
networks (such as Token-Ring and Ethernet). Thus, if two physically
different networks have to communicate, the packets that arrive at the Data
Link Layer of the node which connects these two physically different
networks, would be stripped of their headers and passed to the Network
Layer. The network layer would then pass this data to the Data Link Layer
of the other physical network..
3. Congestion Control - If the incoming rate of the packets arriving at any
router is more than the outgoing rate, then congestion is said to occur.
Congestion may be caused by many factors. If suddenly, packets begin
arriving on many input lines and all need the same output line, then a queue
will build up. If there is insufficient memory to hold all of them, packets
will be lost. But even if routers have an infinite amount of memory,
congestion gets worse, because by the time packets reach to the front of the
queue, they have already timed out (repeatedly), and duplicates have been
sent. All these packets are dutifully forwarded to the next router, increasing
the load all the way to the destination. Another reason for congestion are
slow processors. If the router's CPUs are slow at performing the
bookkeeping tasks required of them, queues can build up, even though there
is excess line capacity. Similarly, low-bandwidth lines can also cause
congestion.
Addressing Scheme
IP addresses are of 4 bytes and consist of :
i) The network address, followed by
ii) The host address
The first part identifies a network on which the host resides and the second part
identifies the particular host on the given network. Some nodes which have more
than one interface to a network must be assigned separate internet addresses for
each interface. This multi-layer addressing makes it easier to find and deliver data
to the destination. A fixed size for each of these would lead to wastage or under-
usage that is either there will be too many network addresses and few hosts in each
(which causes problems for routers who route based on the network address) or
there will be very few network addresses and lots of hosts (which will be a waste
for small network requirements). Thus, we do away with any notion of fixed sizes
for the network and host addresses.
We classify networks as follows:
1. Large Networks : 8-bit network address and 24-bit host address. There are
approximately 16 million hosts per network and a maximum of 126 ( 2^7 - 2
) Class A networks can be defined. The calculation requires that 2 be
subtracted because 0.0.0.0 is reserved for use as the default route and
127.0.0.0 be reserved for the loop back function. Moreover each Class A
network can support a maximum of 16,777,214 (2^24 - 2) hosts per
network. The host calculation requires that 2 be subtracted because all 0's
are reserved to identify the network itself and all 1s are reserved for
broadcast addresses. The reserved numbers may not be assigned to
individual hosts.
2. Medium Networks : 16-bit network address and 16-bit host address. There
are approximately 65000 hosts per network and a maximum of 16,384
(2^14) Class B networks can be defined with up to (2^16-2) hosts per
network.
3. Small networks : 24-bit network address and 8-bit host address. There are
approximately 250 hosts per network.
The process of moving the data packets towards their destination by forwarding them from one
port to the other port is called as switching.
Switching Techniques-
Various switching techniques are-
1. Circuit Switching
2. Message Switching
3. Packet Switching
Circuit Switching-
1. Establishing a circuit
2. Transferring the data
3. Disconnecting the circuit
1. Establishing A Circuit-
In this phase,
The entire data travels over the dedicated path from one end to the other end.
Total Time-
where-
A well defined and dedicated path exists for the data to travel.
There is no header overhead.
There is no waiting time at any switch and the data is transmitted without any
delay.
Data always reaches the other end in order.
No re ordering is required.
Disadvantages-
Circuit switching has the following disadvantages-
Important Notes-
Problem-
Consider all links in the network use TDM with 24 slots and have a data rate of 1.536
Mbps. Assume that host A takes 500 msec to establish an end to end circuit with host B
before begin to transmit the file. If the file is 512 kilobytes, then how much time will it
take to send the file from host A to host B?
Solution-
Given-
Message Switching-
In message switching,
Advantages-
Point-01:
Point-02:
Point-03:
It is helpful in setting the message priorities due to store and forward technique.
Disadvantages-
Point-01:
Point-02:
To gain better understanding about Message Switching,
Packet Switching-
In packet switching,
The entire message to be sent is divided into multiple smaller size packets.
This process of dividing a single message into smaller size packets is called
as packetization.
These smaller packets are sent after the other.
It gives the advantage of pipelining and reduces the total time taken to transmit
the message.
Example-
Consider-
Out of the following, in how many packets the message must be divided so that total
time taken is minimum-
1. 1 packet
2. 5 packets
3. 10 packets
4. 20 packets
NOTE
While calculating the total time, we often ignore the propagation delay.
The reason is in packet switching, transmission delay dominates over propagation delay.
This is because each packet is transmitted over the link at each hop.
Let us analyze each case one by one.
Size Of Packet-
Packet size
= 1000 bytes of data + 100 bytes of header
= 1100 bytes
Transmission Delay-
Transmission delay
= Packet size / Bandwidth
= 1100 bytes / 1 MBps
= 1100 x 10-6 sec
= 1100 μsec
= 1.1 msec
Transmission Delay-
Transmission delay
= Packet size / Bandwidth
= 300 bytes / 1 MBps
= 300 x 10-6 sec
= 300 μsec
= 0.3 msec
Transmission Delay-
Transmission delay
= Packet size / Bandwidth
= 200 bytes / 1 MBps
= 200 x 10-6 sec
= 200 μsec
= 0.2 msec
Transmission Delay-
Transmission delay
= Packet size / Bandwidth
= 150 bytes / 1 MBps
= 150 x 10-6 sec
= 150 μsec
= 0.15 msec
Observations-
Conclusion-
We conclude-
Total time decreases when packet size is reduced but only up to a certain limit.
If the packet size is reduced beyond a certain limit, then total time starts
increasing.
From the given choices,
1. Virtual Circuit Switching
2. Datagram Switching
1. Establishing A Circuit-
In this phase,
Datagram Switching-
In datagram switching,
Data appears in order at the destination Data may appear out of order at the
since all the packets take the same destination since the packets take path
dedicated path. independently.
It is highly reliable since no packets are It is not reliable since packets may be
discarded. discarded.
It is costly. It is cost effective.
Problem-
In a packet switching network, packets are routed from source to destination along a
single path having two intermediate nodes. If the message size is 24 bytes and each
packet contains a header of 3 bytes, then the optimum packet size is-
1. 4 bytes
2. 6 bytes
3. 7 bytes
4. 9 bytes
Solution-
Let bandwidth of the network = X Bps and 1 / X = a
Number Of Packets-
Number of packets required
= Total data to be sent / Data contained in one packet
= 24 bytes / 1 byte
= 24 packets
Transmission Delay-
Transmission delay
= Packet size / Bandwidth
= 4 bytes / X Bps
= 4a sec
Number Of Packets-
Number of packets required
= Total data to be sent / Data contained in one packet
= 24 bytes / 3 bytes
= 8 packets
Transmission Delay-
Transmission delay
= Packet size / Bandwidth
= 6 bytes / X Bps
= 6a sec
Number Of Packets-
Number of packets required
= Total data to be sent / Data contained in one packet
= 24 bytes / 4 bytes
= 6 packets
Transmission Delay-
Transmission delay
= Packet size / Bandwidth
= 7 bytes / X Bps
= 7a sec
Number Of Packets-
Number of packets required
= Total data to be sent / Data contained in one packet
= 24 bytes / 6 bytes
= 4 packets
Transmission Delay-
Transmission delay
= Packet size / Bandwidth
= 9 bytes / X Bps
= 9a sec
Observations-
From here,
Result-
Time taken is minimum when packet size is 9 bytes.
Thus, Option (D) is correct.
Packet Switching
Circuit Switching
Virtual Circuit Switching Datagram Switching
A dedicated path exists for A dedicated path exists for No dedicated path exists for
data transfer data transfer data transfer
All the packets take the same All the packets take the same All the packets may not take
path path the same path
Fetched URL: https://www.scribd.com/document/456114796/CN-unit3-part1-docx
Alternative Proxies: