UNIT 4 Syllabus Filtered (1)
UNIT 4 Syllabus Filtered (1)
Hub
Discard F E D Discard
Accept
Switch
• Switch is used to connect several terminals
• Switch directs information to specific workstations.
• Switch allows each workstation to transmit information based on
physical address.
• Normally, switch is a layer 2 device.
• A link- layer switch has filtering capability which check the destination
address of a frame and can from which outgoing port the frame
should be sent.
Switch
switch
1 4
2 3
71:2B:13:45:61:41 A B C D 71:2B:13:45:61:12
71:2B:13:45:61:42 71:2B:13:45:61:43
Address Port
71:2B:13:45:61:41 1
71:2B:13:45:61:42 2
71:2B:13:45:61:43 3
71:2B:13:45:61:12 4
Bridge
• Bridge functions at the data link layer of the OSI model.
• The function of bridge is very similar to switch.
• A bridge can divide an overloaded network into smaller, more
efficient network.
• Bridge filter traffic based on the destination address of the frame.
Token
Router
Ring
10 BaseT LAN
Bridge
10 BaseT LAN
Gateway
• Gateway is a multipurpose connection device.
• Gateway operates at the session layer and the above.
• They are able to convert the format (data translation) example;
between ASCII and EBCDIC, compression and decompression and so
on.
• Gateways are the most complex devices with respect to the
functionality.
Network Layer
• It is concerned with getting packets from source to destination.
• The network layer studies the topology of the subnet and chooses
appropriate path.
Internet Protocol (IP)
• The network protocol in the internet is called internet protocol.
• This is host to host network delivery protocol designed for internet.
• IP is a connectionless datagram protocol with no guarantee of
reliability.
• IP can only detects the error and discards it if it is corrupted.
IP(IPv4) data format
Field Description
• Version: Indicates the version of this IP datagram.
• IP Header Length (IHL): Indicates the datagram header length in 32-bit words.
• Type-of-Service: Defines the class of the datagram for quality of service purposes. It specifies the priority of the packet based on delay, throughput,
reliability and cost requirement.
• Total Length: Specifies the length of the entire IP packet, including data and header, in bytes.
• Identification: this field identifies the datagram originating from the source host. When a datagram is fragmented, the value in the identification field
is copied into all fragments. The identification number helps the destination in reassembling the fragments of the datagram. of an integer identifying
this datagram. This field is used to help piece together datagram fragments.
• Flags: defines DF= Don’t fragment and MF= More fragment
• Fragmentation offset: tell where in the current datagram this fragment belongs.
• Time-to-Live: Maintains a counter that gradually decrements down to zero, at which point the datagram is discarded. This keeps packets from looping
endlessly.
• Protocol: Indicates which upper-layer protocol receives incoming packets after IP processing is complete.
• Header Checksum: Helps ensure IP header integrity.
• Source Address: Specifies the sending node.
• Destination Address: Specifies the receiving node.
• Options: Allows IP to support various options, such as security.
• Data: Contains upper-layer information.
IP Addressing
• An identifier used in the IP layer of the TCP/IP protocol suite to
identify the connection of each device to Internet.
• Made of four bytes (32 bits).
Class Type Net ID Host ID
• Notation :
Binary 10000000.00001011.00000011.00011111
Decimal 128 .11 .3 .31
• IP address is generally written in dotted decimal notation.
IP address
Calculation of IP range
Class A
00000000.00000000.00000000.00000000
01111111.11111111.11111111.11111111
0.0.0.0 – 127.255.255.255
Similarly,
Class B 128.0.0.0 – 191.255.255.255
Class C 192.0.0.0 – 223.255.255.255
Class D 224.0.0.0 – 239.255.255.255
Class E 240.0.0.0 – 255.255.255.255
Address Distribution concept
Class A net.host.host.host
network bits=7
host bits = 24
Total no. of network=27 =128
Total no. of hosts= 224 − 2 = 16777214
Class B net.net.host.host
network bits=14
host bits = 16
Total no. of network=214 =16384
Total no. of hosts= 216 − 2= 65534
Address Distribution concept
Class C net.net.net.host
network bits=21
host bits = 8
Total no. of network=221 =2097152
Total no. of hosts= 28 − 2 = 254
Class D
-used as multicast IP
-it is a unique network that directs packets with that destination address to predefined groups
for IP address.
Class E
-reserved for future use
Types of IP address
• Public IP
• Numbers used in Internet
• Unique world wide
• Given by ISP
• Private IP
• Any organization can use an address out of this set without permission from the
Internet authorities
• These addresses are free to use.
• Address for private networks:
• Class A → 10.X.Y.Z
• Class B → 172.16.X.Y – 172.31.255.254
• Class C→ 192.168.X.Y
Classful Address
• Default mask for classful address
Client Server
DHCP Discover
DHCP Offer
DHCP Request
DHCP ACK
Time Time
Subnetting
• Subnetting is the process of dividing network into several smaller
subnetworks with each subnetwork having its own subnetwork
address.
• Benefits:
• It reduces the network traffic
• It simplifies the management
• It breaks down the broadcast domain.
Subnet Mask
• It extracts the network address from an IP address when subnetting is
not used.
• It extracts the subnetwork address from an IP address when
subnetting is used.
• In a subnet mask, we change some of the leftmost 0s in the default
mask to make a subnet mask,
Subnet address
• Given IP: 130.45.34.56
Mask: 255.255.0.0
What is the subnet address?
Sol:
IP : 10000010.00101101.00100010.00111000
Mask : 11111111.11111111.00000000.00000000
Anding
10000010.00101101.00000000.00000000
130.45.0.0 is the subnet address.
Network Address Translation (NAT)
• NAT enables a user to have a large set of addresses
internally and one address, or a small set of
addresses, externally.
Routing
Routing can be done by central computer or by each router.
• Centralized
• A central computer calculates all possible paths and dictates router in the
network
• Distributed routing
• Each router calculates paths with available information
Criteria for a good routing algorithm
• Correctness: correct route and accurate delivery of packets
• Robustness: adaptive to changes of network topology and varying traffic
load
• Cleverness: ability to detour congestion links and determine the
connectivity of the network
• Stability: avoiding the loops through the network when congestion.
• Optimality and fairness: some performance criteria may give higher priority
to the exchange of packets between nearby stations compared to an
exchange between distant stations. This may maximize average throughput
but will appear unfair to the station that primarily needs to communicate
with distant stations.
• Efficiency: rapid finding of the router and minimization of control
messages.
Routing Techniques
Routing can be divided two groups as:
• Non-adaptive routing (Static Routing)
• The routing decision is not based on the measurement or estimation of current-
traffic and topology
• The choice of route is done in advance
• Good for small and fixed network topology
• This is called static routing
• Adaptive routing(dynamic routing)
• The routing decision is changed if there are any changes in topology or traffic
• Each router learns the network topology by exchanging information with its
neighbors
• Different factors can be involved in dynamic routing are bandwidth, delay, load, hop
count.
• This is called dynamic routing
Routing Algorithm
• A Routing Algorithm is that part of network layer software
responsible for deciding which output line and incoming packet
should be transmitted on.
• Some of the algorithms are:
• Shortest Path Algorithm
• Flooding
• Distance Vector Algorithm
• Link State Algorithm
Shortest path algorithm
• Given a network topology and a set of weights describing the cost to
send data across each link in the network
• Find the shortest path from a specified source to all other
destinations in the network.
• Shortest path algorithm first developed by E. W. Dijkstra
Shortest Path Routing
Distance Vector Routing (DVR)
It operated by having each router maintaining a table giving the best-known
distance to each destination.
Some of the keys to understand this algorithm are:
1. Knowledge about the whole network
Each router shares its knowledge about the entire AS with neighbours. It
sends whatever it has.
2. Routing only to neighbours
Sharing only with immediate neighbours. Each router sends whatever
knowledge it has through all its interface.
3. Sharing information at regular intervals
Sharing at regular intervals. sends at fixed intervals, e.g. every 30 sec.
• Problems: Tedious comparing/updating process, slow response to infinite
loop problem, huge list to be maintained.
39
Initialization of tables in DVR
40
Drawbacks of DVR
• Its slow convergence
• The algorithm does not take the line bandwidth into consideration
when choosing route.
• May suffer from routing loop called count-to-infinity problem.
Count to Infinity
Link State Routing
• Every router maintains its link state packet(LSP) which records the
state information of links to all its neighbors.
• A router floods its LSP to entire network, i.e., all routers,
• When a router receives LSPs from other routers, it can construct a
map of entire network and from the map, computer shortest paths
between any pair of host.
Link State Routing
Five Steps
1.) Discover your neighbors and learn their addresses.
2.) Measure the cost (delay) to each neighbor.
3.) Construct a packet containing all this information
4.) Send this packet to all other routers.
5.) Compute the shortest path to every other router.
Link State Routing
3 keys to understand how this algorithm works:
1. Sharing knowledge about the neighbourhood.
• Instead of sending its entire routing table, a router sends information about its
neighbourhood only.
2. Sharing with every other routers.
• Through process of flooding. each router sends the state of its neighbourhood through all
its output ports and each neighbour sends to every other neighbours and so on until all
routers received same full information eventually
3. Sharing when there is a change.
• Each router share its state of its neighbour only when there is a change; contrasting DVR
results in lower traffic.
• From the received LSPs and knowledge of entire topology, a router can then
calculate the shortest path between itself and each network.
Routing Protocols: Interior vs Exterior
53
Example of Final routing tables
54
Areas in an Autonomous System
(AS>Areas)
OSPF divides an AS into areas. An area is a collection of network, hosts and routers
all contained within an AS. Routers inside an area flood the area with routing info. At
the border of an Area, special routers called Area Border routers summarize the info.
about the area and send it to other area. Among the areas inside an AS is a special area
called the Backbone connecting all areas through Backbone routers and serves as a
primary area to the outside (other ASs) via the AS Boundary router. 56
Types of BGP messages