Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 49

 Casting

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.

• Broadcast Transmission (One-to-All)


In Broadcast transmission, the data is transmitted from one or more senders to all the receivers within the
same network or in other networks.
i. Directed Broadcast

Directed Broadcast transmits data from one source host to all the other hosts that exist in some other network.

ii. Limited Broadcast

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.

Phases of Link State Routing

 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

4. Random early discard

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

1. A more direct way of telling the source to slow down.

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.

4. An example of a choke packet is the ICMP Source Quench Packet.


 Hop-by-Hop Choke Packets

1. Over long distances or at high speeds choke packets are not very effective.

2. A more efficient method to send to choke packets is hop-by-hop.

3. This requires each hop to reduce its transmission even before the choke packet arrives at the source
 Load Shedding

1. When buffers become full, routers simply discard packets.

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)

• A stream of packets from a source to a destination is called a flow.

 In a connection-oriented network, all the packets belonging to a flow follow the same route.

 In a connectionless network, they may follow different routes.

• 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

Another method is to “shape” the traffic before it enters the network.

• 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.

(a) Before. (b) After.


 Jitter is defined as the variation in the delay (or latency) of received packets.

 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 is connectionless because it treats each packet of information independently. It is unreliable because it


does not guarantee delivery, meaning, it does not require acknowledgments from the sending host, the
receiving host, or intermediate hosts.

• 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

An IP datagram consists of a header part and a text part.

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.

Originally, the 6-bit field contained (from left to


right), a three-bit Precedence field and three
flags, D, T, and R. The Precedence field was a
priority, from 0 (normal) to 7 (network control
packet). The three flag bits allowed the host to
specify what it cared most about from the set
{Delay, Throughput, Reliability}.
The Total length includes everything in the datagram—both header and data. The maximum length is
65,535 bytes. At present, this upper limit is tolerable, but with future gigabit networks, larger datagrams
may be needed.
The Identification field is needed to allow the destination host to determine which datagram a newly
arrived fragment belongs to. All the fragments of a datagram contain the same Identification value.
Next comes an unused bit and then two 1-bit fields. DF stands for Don't Fragment. It is an order to the routers not
to fragment the datagram because the destination is incapable of putting the pieces back together again. By marking
the datagram with the DF bit, the sender knows it will arrive in one piece.

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 original design, to permit experimenters to try out new ideas, and to avoid allocating header bits to
information that is rarely needed.
The Security 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 network ID is 8 bits long.


•The host ID is 24 bits long.

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

IP addresses belonging to class A ranges from 1.x.x.x – 126.x.x.x


Class B:
IP address belonging to class B are assigned to the networks that ranges from medium-sized to large-sized networks.

•The network ID is 16 bits long.


•The host ID is 16 bits long.

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:

•2^14 = 16384 network address


•2^16 – 2 = 65534 host address

•IP addresses belonging to class B ranges from 128.0.x.x – 191.255.x.x.


Class C:
IP address belonging to class C are assigned to small-sized networks.
• The network ID is 24 bits long.
• The host ID is 8 bits long.
The higher order bits of the first octet of IP addresses of class C are always set to 110. The remaining 21 bits are used to
determine network ID. The 8 bits of host ID is used to determine the host in any network. The default sub-net mask for
class C is 255.255.255.x. Class C has a total of:

2^21 = 2097152 network address


2^8 – 2 = 254 host address
IP addresses belonging to class C ranges from 192.0.0.x – 223.255.255.x.
Class D:
IP address belonging to class D are reserved for multi-casting. The higher order bits of the first octet of IP addresses
belonging to class D are always set to 1110. The remaining bits are for the address that interested hosts recognize.
Class D does not posses any sub-net mask. IP addresses belonging to class D ranges from 224.0.0.0 –
239.255.255.255.
Class E:
IP addresses belonging to class E are reserved for experimental and research purposes. IP addresses of class E ranges from
240.0.0.0 – 255.255.255.254. This class doesn’t have any sub-net mask. The higher order bits of first octet of class E are
always set to 1111.
Range of special IP addresses:
169.254.0.0 – 169.254.0.16 : Link local addresses
127.0.0.0 – 127.0.0.8 : Loop-back addresses
0.0.0.0 – 0.0.0.8 : used to communicate within the current network.

Rules for assigning Host ID:

Host ID’s are used to identify a host within a network. The host ID are assigned based on the following rules:

Within any network, the host ID must be unique to that network.

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.

A campus network consisting of LANs for various departments


To implement subnetting, the main router needs a subnet mask that indicates the split between network +
subnet number and host, as shown in Fig. Subnet masks are also written in dotted decimal notation, with
the addition of a slash followed by the number of bits in the network + subnet part. For the example of Fig.,
the subnet mask can be written as 255.255.252.0. An alternative notation is /22 to indicate that the subnet
mask is 22 bits long.

Fig: A class B network subnetted into 64 subnets.


In this example, the first subnet might use IP addresses starting at 130.50.4.1; the second subnet might
start at 130.50.8.1; the third subnet might start at 130.50.12.1; and so on. To see why the subnets are
counting by fours, note that the corresponding binary addresses are as follows:

Subnet 1: 10000010 00110010 000001|00 00000001


Subnet 2: 10000010 00110010 000010|00 00000001
Subnet 3: 10000010 00110010 000011|00 00000001

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.

You might also like