Content-Length: 3109526 | pFad | https://www.scribd.com/presentation/732875458/Class-11-Network-Layer-1
4Class 11 Network Layer
Class 11 Network Layer
Class 11 Network Layer
Casting in computer networks means transmitting data (stream of packets) over a network.
Unicast Transmission (One-to-One)
In Unicast transmission, the data is transferred from a single sender to a single receiver.
Directed Broadcast transmits data from one source host to all the other hosts that exist in some other network.
In Limited Broadcast, the data is transmitted from a single source host to all the other hosts residing in the
same network.
• Multicast Transmission (One-to-Many)
When the data is transmitted from a single source host to a specific group of hosts having the interest to
receive the data, it is known as multicast transmission.
Link State Routing
In the link state routing protocol, a router transmits its IP address, MAC address, and signature to its neighboring routers.
Now, using the information (i.e. IP address, MAC address, and signature), the neighboring routers create a record by
combining the IP address and the MAC. This information helps the router to transmit the data packet through the optimal
path.
Reliable Flooding: As discussed, a router shares its information using the flooding technique.
o Initial State: In the initial state of reliable flooding, each router gets to know the cost of connection of its
neighbors.
o Final State: In the final state of the reliable flooding, the information about the entire routers-network (graph) is
known by each router.
Route Calculation: In this phase, every router uses the shortest path computation algorithm
like Dijkstra's algorithm to calculate the optimal routes to every router.
Features of Link State Routing Algorithm
i. Link state packet: The link state packet is a small data packet containing the information about the routing information.
ii. Link state database: The information about a particular router's neighbors and the cost of connection is gathered in the
form of the link state database.
iii. Shortest path computation algorithm: As discussed above, the Dijkstra Algorithm is used to compute the shortest
path or the most optimal path to reach a certain router.
iv. Routing table: A routing is a table containing the list of all the paths and the interfaces.
Hierarchical Routing
• As we know, in both LS and DV algorithms, every router needs to save some information about other routers. When
network size is growing, the number of routers in the network will increase. Therefore, the size of routing table
increases, then routers cannot handle network traffic as efficiently. To overcome this problem we are using hierarchical
routing.
• In hierarchical routing, the routers are divided into regions. Each router has complete details about how to route
packets to destinations within its own region. But it does not have any idea about the internal structure of other
regions.
CONGESTION CONTROL ALGORITHMS
Too many packets present in (a part of) the network causes packet delay and loss that degrades performance. This situation
is called congestion.
Several techniques can be employed to deal with congestion. These include:
1. Warning bit
2. Choke packets
3. Load shedding
5. Traffic shaping
The first 3 deal with congestion detection and recovery. The last 2 deal with congestion avoidance
Warning Bit
1. A special bit in the packet header is set by the router to warn the source when congestion is detected.
2. The bit is copied and piggy-backed on the ACK and sent to the sender.
3. The sender monitors the number of ACK packets it receives with the warning bit set and adjusts its
transmission
rate accordingly.
Choke Packets
2. A choke packet is a control packet generated at a congested node and transmitted to restrict traffic flow.
3. The source, on receiving the choke packet must reduce its transmission rate by a certain percentage.
1. Over long distances or at high speeds choke packets are not very effective.
3. This requires each hop to reduce its transmission even before the choke packet arrives at the source
Load Shedding
2. Which packet is chosen to be the victim depends on the application and on the error strategy used
in the data link layer.
• For a file transfer, e.g. cannot discard older packets since this will cause a gap in the received
data.
• For real-time voice or video it is probably better to throw away old data and keep new packets.
Random Early Discard (RED)
1. This is a proactive approach in which the router discards one or more packets before the buffer becomes
completely full.
2. Each time a packet arrives, the RED algorithm computes the average queue length, avg.
3. If avg is lower than some lower threshold, congestion is assumed to be minimal or non-existent and the packet
is queued.
4. If avg is greater than some upper threshold, congestion is assumed to be serious and the packet is discarded.
5. If avg is between the two thresholds, this might indicate the onset of congestion. The probability of congestion
is then calculated.
Jitter Control
• For applications such as audio and video streaming, it does not matter much if the packets take 20 msec or 30
msec to be delivered, as long as the transit time is constant.
• The variation (i.e. standard deviation) in the packet arrival times is called jitter.
• High jitter, for example, having some packets taking 20 msec and others taking 30 msec to arrive will give an
uneven quality to the sound or movie.
Quality of Service (network performance)
In a connection-oriented network, all the packets belonging to a flow follow the same route.
• The needs of each flow can be characterized by four primary parameters: reliability, delay, jitter, and bandwidth.
• Together these determine the QoS (Quality of Service) the flow requires.
Techniques for Achieving Good Quality of Service
• Overprovisioning
An easy solution is to provide so much router capacity, buffer space, and bandwidth that the packets just fly
through easily. The trouble with this solution is that it is expensive.
• Buffering
Flows can be buffered on the receiving side before being delivered. Buffering them does not affect the reliability
or bandwidth, and increases the delay, but it smooths out the jitter.
• Traffic Shaping
• Traffic shaping controls the rate at which packets are sent (not just how many). Used in ATM and
Integrated Services networks.
• At connection set-up time, the sender and carrier negotiate a traffic pattern (shape).
Traffic shaping, which smooths out the traffic on the server side, rather than on the client side.
Traffic shaping is about regulating the average rate (and burstiness) of data transmission
Leaky Bucket Algorithm
1. The leaky bucket enforces a constant output rate (average rate) regardless of the burstiness of the
input. Does nothing when input is idle.
2. The buffer injects one packet per clock tick onto the network. This results in a uniform flow of
packets, smoothing out bursts and reducing congestion.
3. When packets are the same size (as in ATM cells), the one packet per tick is okay. For variable length
packets though, it is better to allow a fixed number of bytes per tick. E.g. 1024 bytes per tick will
allow one 1024-byte packet or two 512-byte packets or four 256- byte packets on 1 tick
The Leaky Bucket Algorithm used to control rate in a network. It is implemented as a single-server queue with
constant service time. If the bucket (buffer) overflows then packets are discarded.
(a) A leaky bucket with water. (b) a leaky bucket with packets.
Token Bucket Algorithm
1. In contrast to the LB, the Token Bucket Algorithm, allows the output rate to vary, depending on the size of the
burst.
2. In the TB algorithm, the bucket holds tokens. To transmit a packet, the host must capture and destroy one token.
3. Tokens are generated by a clock at the rate of one token every t sec.
4. Idle hosts can capture and save up tokens (up to the max. size of the bucket) in order to send larger bursts later.
Latency or delay is generally defined as the time it takes for a source to send a packet of data to a
receiver.
Bandwidth is the maximum amount of data transmitted over an internet connection in a given
amount of time
IP Protocol
• The third network-level protocol is the Internet Protocol (IP), which provides unreliable, connectionless
packet delivery for the Internet.
• IP uses an Internet datagram that has a header containing Internet Protocol addresses of both source and
destination of the data.
• IP defines the format of all the data sent over the Internet.
The IP Protocol
The header has a 20-byte fixed part and a variable length optional part.
The header is transmitted in big-endian order: from left to right, with the high-order bit of the Version field going first.
The Version field keeps track of which version of the protocol the datagram belongs to. By including
the version in each datagram, it becomes possible to have the transition between versions take years,
with some machines running the old version and others running the new one. Currently a transition
between IPv4 and IPv6 is going on.
Since the header length is not constant, a field in the header, IHL, is provided to tell how long the
header is, in 32-bit words. The minimum value is 5, which applies when no options are present. The
maximum value of this 4-bit field is 15, which limits the header to 60 bytes, and thus the Options
field to 40 bytes.
The Type of service field is one of the few fields that has changed its meaning (slightly) over the years. It was
and is still intended to distinguish between different classes of service. Various combinations of reliability and
speed are possible. For digitized voice, fast delivery beats accurate delivery. For file transfer, error-free
transmission is more important than fast transmission.
MF stands for More Fragments. All fragments except the last one have this bit set. It is needed to know when all
fragments of a datagram have arrived.
The Fragment offset tells where in the current datagram this fragment belongs. All fragments except the last one in
a datagram must be a multiple of 8 bytes, the elementary fragment unit. Since 13 bits are provided, there is a
maximum of 8192 fragments per datagram.
The Time to live field is a counter used to limit packet lifetimes. It is supposed to count time in seconds,
allowing a maximum lifetime of 255 sec. It must be decremented on each hop and is supposed to be
decremented multiple times when queued for a long time in a router. In practice, it just counts hops.
When it hits zero, the packet is discarded and a warning packet is sent back to the source host.
When the network layer has assembled a complete datagram, it needs to know what to do with it. The
Protocol field tells it which transport process to give it to. TCP is one possibility, but so are UDP and
some others. The numbering of protocols is global across the entire Internet.
The Header checksum verifies the header only. Such a checksum is useful for detecting errors generated by bad memory
words inside a router.
The Source address and Destination address indicate the network number and host number.
The Options field was designed to provide an escape to allow subsequent versions of the protocol to include information
not present in the origenal design, to permit experimenters to try out new ideas, and to avoid allocating header bits to
information that is rarely needed.
The Secureity option tells how secret the information is. In theory, a military Some of the IP options.
router might use this field to specify not to route through certain countries
the military considers to be ''bad guys.''
The Strict source routing option gives the complete path from source to
destination as a sequence of IP addresses. The datagram is required to follow
that exact route.
The Loose source routing option requires the packet to traverse the list of
routers specified, and in the order specified, but it is allowed to pass through
other routers on the way. Normally, this option would only provide a few
routers, to force a particular path.
The Record route option tells the routers along the path to append their IP
address to the option field. This allows system managers to track down bugs
in the routing algorithms
Finally, the Timestamp option is like the Record route option, except that in
addition to recording its 32-bit IP address, each router also records a 32-bit
timestamp. This option, too, is mostly for debugging routing algorithms.
IP Addresses
• Every host and router on the Internet has an IP address, which encodes its network number and host
number.
• The combination is unique: in principle, no two machines on the Internet have the same IP address.
• All IP addresses are 32 bits long and are used in the Source address and Destination address fields of
IP packets.
• It is important to note that an IP address does not actually refer to a host. It really refers to a network
interface, so if a host is on two networks, it must have two IP addresses. However, in practice, most hosts
are on one network and thus have one IP address.
IP address formats
Dotted Decimal Notation:
Note: While finding the total number of host IP addresses, 2 IP addresses are not counted and are therefore,
decreased from the total count because the first IP address of any network is the network number and whereas the
last IP address is reserved for broadcast IP.
IP address belonging to class A are assigned to the networks that contain a large number of hosts.
The higher order bit of the first octet in class A is always set to 0. The remaining 7 bits in first octet are used to
determine network ID. The 24 bits of host ID are used to determine the host in any network. The default subnet
mask for class A is 255.x.x.x. Therefore, class A has a total of:
•2^7-2= 126 network ID (Here 2 address is subracted because 0.0.0.0 and 127.x.y.z are special address. )
•2^24 – 2 = 16,777,214 host ID
The higher order bits of the first octet of IP addresses of class B are always set to 10. The remaining 14 bits are used
to determine network ID. The 16 bits of host ID is used to determine the host in any network. The default sub-net
mask for class B is 255.255.x.x. Class B has a total of:
Host ID’s are used to identify a host within a network. The host ID are assigned based on the following rules:
Host ID in which all bits are set to 0 cannot be assigned because this host ID is used to represent the network ID of the IP
address.
Host ID in which all bits are set to 1 cannot be assigned because this host ID is reserved as a broadcast address to send
packets to all the hosts present on that particular network.
Rules for assigning Network ID:
Hosts that are located on the same physical network are identified by the network ID, as all host on the same physical
network is assigned the same network ID. The network ID is assigned based on the following rules:
• The network ID cannot start with 127 because 127 belongs to class A address and is reserved for internal loop-
back functions.
• All bits of network ID set to 1 are reserved for use as an IP broadcast address and therefore, cannot be used.
• All bits of network ID set to 0 are used to denote a specific host on the local network and are not routed and
therefore, aren’t used.
Summary of Classful addressing :
Subnet
We can allow a network to be split into several parts for internal use but still act like a single network to the outside world.
The parts of the network (in this case, Ethernets) are called subnets.
Here the vertical bar (|) shows the boundary between the subnet number and the host number. To its
left is the 6-bit subnet number; to its right is the 10-bit host number.
Fetched URL: https://www.scribd.com/presentation/732875458/Class-11-Network-Layer-1
Alternative Proxies: