TCP/IP & ROUTING PROTOCOLS V.Maheswaran Nair Sub Divisional Engineer BSNL,Trivandrum.
TCP/IP (Transmission Control Protocol/ Internet Protocol)
TCP/IP TCP/IP Protocols provide the ability to connect machines regardless of the underlying network cabling & the Operating Systems in use.
TCP/IP is a piece of networking software for the Internet and networks worldwide.
TCP/IP protocol suite contain two main things: Network Applications HTTP (Hyper Text Transfer Protocol) WWW Services FTP (File Transfer Protocol) for transferring file SMTP Simple Mail Transfer Protocol) for E Mail DNS (Domain Name System) etc… TCP is Used
Networking protocols Moving packet of data from Source to Destination Internet Protocols (IP) and Routing Protocols are used.
TCP is responsible for: Data concurrency Packet Sequencing Delivery guarantee Error Control Retransmission
Internet address
MAC address
Port address
(Node to Node)
(Application) IP address
16 bit
(Source to
Decimal Notation
Destination)
MAC address 48 bit (6 Bytes) Hexa Decimal Notation
AB
0F Vendor ID
25
B6
C5 Serial No
D2
IP Address
Each Internet address consists of 4 bytes (32-bits), defining two parts: Netid Hostid These parts are of varying lengths depending upon the class of the address.
Dotted Decimal Notation
To make the 32-bit address form more compact and easier to read, Internet addresses are usually written in decimal form with decimal points separating the bytes.
10000000 00001011 00000011 00011111
128.11.3.31
Classes
There are five different IP Address Classes: A, B, C, D & E. These are designed to cover the needs of different types of organizations.
Each address is a pair (Netid and Hostid) where the Netid identifies a network and the Hostid identifies a host on that network. NIB
Net Id
Host Id
Internet Address Classes Byte 1 A 0
Byte 2
NETID
B 10 C 110
Byte 3
Byte 4
HOSTID
NETID
HOSTID
NETID
D 1110
MULTICAST ADDRESS
E 1111
FOR FUTURE USE
HOSTID
IP Address Classes Class
A Address : N.H.H.H Class B Address : N.N.H.H Class C Address : N.N.N.H
IP address - Classes •IP addressing supports five different address classes - A, B,C,D,E •CLASS A,B,C are available for commercial uses. •The left most bits indicate the network class.
Network Class A 0xxxxxxx
Class B
xxxxxxxx
Host xxxxxxxx
xxxxxxxx
Network 10xxxxxx xxxxxxxx 10
Host xxxxxxxx xxxxxxxx
Network xxxxxxxx
Host xxxxxxxx
Class C 110xxxxx 110
xxxxxxxx
Identifying a class of address Address Identifier
A
0
B
10
C
110
D
1110
E
1111
Network Id
7 bits Network Bits 14 bits Network Bits 21 bits Network Bits
Host Id 24 bits Host Id 16 bits Host Id 8 bits Host Id
Multicast address (224.0.0.0-239.255.255.255) Reserved for future use
IP Address Bit Patterns 8 Bits 8 Bits 8 Bits 8 Bits Class-A:
00000000
01111111
0-127
Class-B:
10000000
10111111
128-191
Class-C:
11000000
11011111
192-223
Class-D:
11100000
11101111
224-239
Class-E:
11110000
11111111
240-255
Address space utilisation 12 12 8 0111111 7 100000 1 00
100%
B-25% 1011111 19 1 1 19 2 110000 00 C-12.5% 1101111 1 22 D-6.25% 3 22 E-6.25%
0 1 0
0
A-50%
1 1
0 1
1110000 4 23 0 0 1110111 9 24 1 0 25 11110000 1111111 5 1
0000000 0 0
Class A A 0
NETID
HOSTID
Class ‘A’ addresses are The First Octet defines thezero A lot left-most of addresses bit must are be wasted Remaining seven bits define designed for organizations that 7 Each network theoretically can netid. Theoretically, There Two special are actually addresses we can 126 have (hostid 2 to in define this class the as class it is as highly ‘A’. different networks. 24 may have a huge number have up to 2 = 16,777,216 = networks all 128 0s and networks. only hostid because all 1s) two areofused of improbable that an organization computers attached to theirfor hosts. the for addresses purposes. are reserved hasspecial so many computers. networks. special purposes.
Class B B 10
NETID
HOSTID
The Class ‘B’left-most addresses are two bits are 10 A lot of addresses are wasted 1 4 Two Octets define the netid We Each can network have 2 theoretically = 16,384 can designed for midsize The Last next 16-bits 14-bits are used define to define to define the class as ‘B’. Two special addresses (hostid in this class as it the is hosts highly(or 1also 6 define and two octets networks have up to in 2 class = 65,536 ‘B’. organizations that may have a different the hostid. networks. all 0s and hostid all 1s) are used improbable that an organization hostid. routers). large number of computers for purposes. hasspecial so many computers. attached to their networks.
Class C C 110
NETID
HOSTID
Class C addresses are Three Octets define the netid The three leftmost bits are A class next ‘C’ 21-bits network define can have Two addresses (all 0s and all designed for small organizations Theoretically, we can have Eight bits are used to define and one octet define the hostid. 21 110 to define the class as “C’. different 2 =2,097,152 networks. networks. 8 1s) are reserved for special that have a small number of 2the =256 hosts. hostid. addresses. attached to their computers networks.
Class D D 1110
MULTICAST ADDRESS
Class D address is designed There is no netid or hostid; Remaining 28-bits define The first four bits are 1110 to for multicasting. whole address is used for multicast addresses. define the class as ‘D’. multicasting.
Class E E 1111
FOR FUTURE USE
Class E is reserved by the The first four bitsuse. arehostid. 1111 to There is no netid or Internet for future define the class as ‘E’.
FROM A B C D E
TO
0.0.0.0
127.255.255.255
128.0.0.0
191.255.255.255
192.0.0.0
223.255.255.255
224.0.0.0
239.255.255.255
240.0.0.0
255.255.255.255
Number of networks and hosts in each Class
Class
No. of networks
No. of hosts
A
27 – 2 = 126
224 – 2 = 16,777,214
B
214 = 16,384
216 – 2 = 65,534
C
221 = 2,097,152
28 – 2 = 254
D
Not Applicable
Not Applicable
E
Not Applicable
Not Applicable
TCP/IP and OSI OSI
is made of seven layers. TCP/IP protocol is made of five layers. APPLICATION PRESENTATION
APPLICATION
SESSION
OSI Model
TRANSPORT
TRANSPORT
NETWORK
NETWORK
DATA LINK
DATA LINK
PHYSICAL
PHYSICAL
TCP/IP Model
TCP/IP Protocol Suite A
T N D
P
FTP DHCP SMTP TELNET HTTP
TFTP SNMP DNS TCP
ICMP IGMP
UDP IP
ARP
RARP
Ethernet, Token Ring, FDDI, HDLC, FR, PPP, ATM
Protocols defined by the underlying networks
Data Encapsulation Application
Data
Port add (TCP)
TPT Layer (TCP/UDP)
Data
TCP Segment Port add (UDP)
Data
UDP Message NW Layer (IP)
Data Link (MAC) Physical
Source IP
TCP-UDP
Data
Dest IP
IP Datagram Source MAC
IP Header
TCP-UDP Frame
Bits 10000010101001
Data
Dest MAC
TCP Details
Provides application programs access to the network using a reliable connection-oriented transport layer service TCP sends and receives data reliably using sequence numbers and acknowledgements TCP is a byte oriented protocol i.e. every byte in each packet is assigned a sequence number Data stream handed over to TCP is called an unstructured stream TCP divides this data stream into segments for transmission to remote network
TCP Header.. Octet +0
Octet +1
Octet +2
Octet +3
0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
DESTINATION PORT
SOURCE PORT
SEQUENCE NUMBER ACKNOWLEDGEMENT NUMBER HEAD LEN
U A P R S FI R C S S Y N G K H T N CHECKSUM
WINDOW SIZE URGENT POINTER
OPTIONS AND PADDING
TCP Header…
Source & Destination Port (16 Bits)
Port numbers are used to identify a unique application in a machine 65536 (0-65535) port numbers can be defined Theoretically it is possible to run 65535 simultaneous applications in a host The first 1024 ports, port numbers 0-1023 known as well known port numbers, are assigned and are reserved for standard applications and are controlled by IANA The remaining ports, 1024-65535, are dynamic and can be used freely by applications Source port is randomly generated by the source machine
Well known port numbers PORT
DESCRIPTION
20
File Transfer-Data
21
File Transfer-Control
23
Telnet
25
SMTP
53
Domain Name Server
69
Trivial File Transfer
80
WWW
123
Network Time Protocol
179
Border Gateway Protocol
TCP Header…
Sequence Number (32 Bits)
Helps in establishing TCP connections, along with SYN bit, called as Three Way Handshake Helps in maintaining account of amount of data being transferred Identifies where the encapsulated data fits within a data stream from the sender Sequence number is incremented, in the system, every 4 microsecond
Acknowledgement Number (32 Bits)
Helps in maintaining account of amount of data being transferred Identifies the sequence number expected from the other end of data transmission unit
Seq/Ack numbers relation During
TCP Connection Establishment/ Three way handshake
Acknowledgement Number Sent = Sequence Number Received+1
During
Data Transfer
Acknowledgement Number Sent = Sequence Number Received + Data Received in Bytes
Three-Way-Handshake Sender
0
Receiver
1
SN-95426
2
AN-00000
1 0
000B
SN-16780
3
AN- 95427
1 1
000B
SN-95427
4
AN-16781
0 1
000B
0-Closed; 1-Listen; 2-SYN-Sent; 3-SYN-Received; 4-Established
Data Transfer 0
Sender
2
SN-95426 AN-00000
1 0
000B
1 AN- 95427 1 1
4
Receiver
SN-16780
3
000B
SN-95427
AN-16781
0 1
000B
SN-16781
5
AN- 95428 0 1
100B
SN-95428
5
AN-16881
0 1
200B
SN-16881 AN- 95628 0 1
5
150B
SN-95628
5
AN-17031
0 1
250B
SN-17031
AN- 95878 0 1
5
300B
0-Closed; 1-Listen; 2-SYN-Sent; 3-SYN-Received; 4-Established; 5-Data Transfer
Closing a TCP Connection SN - 95880
Sender
6
AN -17334 0 1 1
Receiver
0B
SN - 17334 AN - 95881 0 1 0
0B
WAIT SN - 17334 AN - 95881 0 1 1
SN - 95881
6
0B
AN -17334
0
0 1 0
0B
0 6-Finish; 0- Closed
TCP Header….
Header Length (4 Bits)
Sometimes called Data Offset Indicates the length of header in 32-bit words Identifies the beginning of data Typical value is 5 unless there are options
Flags (6 Bits)
Urgent (URG) Acknowledgement (ACK) Push (PSH) Reset (RST) Synchronisation (SYN) Finish (FIN)
TCP Header….. Window
Size (16 Bits)
Indicates the size of the sliding window Specifies the number of octets, starting with the octet indicated by the acknowledgement number, that the sender of the segment will accept from its peer at the other end of the connection before the peer must stop transmitting and wait for an acknowledgement A default window size is 4096 bytes Used for flow control by using Sliding window mechanism
Flow Control
Sender retains a copy of transmitted data until it receives an acknowledgment from the remote network. If no acknowledgment is received, within a specified time, the data is retransmitted by using adaptive retransmission algorithm.
TCP records the time of the transmission and sequence number of the segment. TCP again records the time of the acknowledgement received. Using this delta, TCP builds a sample round-trip delay time and uses this to build an average time for a packet to be sent and to receive an acknowledgement
TCP will time out after a number of unsuccessful retransmissions
Sliding Window-Flow Control
Moves to right when ack is received.
Sent and ack
Moves to right when data is sent. Moves to right or left to fix the size of the window.
Window Size
Sent but not ack Can be sent Can’t be sent
TCP Header…..
Checksum(16 Bits)
Urgent Pointer(16 Bits)
Used for error detection Covers both header and the encapsulated data Used only when urgent flag is set Points to the last octet of urgent data
Options
One of the important options is MSS (Maximum Segment Size) Informs the receiver of the largest segment the sender is willing to accept, without causing fragmentation
TCP Header…… Padding
Consists of 1-3 octets, each equal to zero, to force the length of TCP header to be in multiples of four octets.
User Datagram Protocol Provides
unreliable connectionless service Transfers data without establishing a session Used for services that have an inbuilt reliability Does not use end to end error checking and correction Does not order the packets; may loose or duplicate a packet Runs faster than TCP due to less overheads
UDP Header..
Octet +0
Octet +1
Octet +2
Octet +3
0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 SOURCE PORT
DESTINATION PORT
MESSAGE LENGTH
CHECKSUM
UDP Header...
Source Port (16 Bits)
Destination Port (16 Bits)
Identifies the receiving process. Some fixed, pre-assigned port numbers used for services on the Internet. 7 for UDP; 69 for TFTP
Message length (16 Bits)
Identifies the sending process.
Indicates the size of the UDP header and its data in bytes. Minimum size is 8, if carries no data.
Checksum (16 Bits)
Covers the UDP header and UDP data. Optional; If not used, set to all zeros.
Internet Protocol.
Provides best-effort or connectionless delivery service. No error checking or tracking If reliability is important, IP must be paired with a reliable protocol like TCP Transmits blocks of data called datagrams each of which is transported separately Responsible for IP addressing Datagrams may travel along different routes and may arrive out of sequence or duplicated.
IP Header.. Octet +0
Octet +1
Octet +2
Octet +3
0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
VER
HLEN
TOS
IDENTIFICATION TIME TO LIVE
PROTOCOL
TOTAL LENGTH DM F F
FRAGMENT OFFSET HEADER CHECKSUM
SOURCE ADDRESS OF HOST DESTINATION ADDRESS OF HOST OPTIONS
PADDING
IP Header…
Version (4 Bits)
Header Length (4 Bits)
Identifies the IP version to which the packet belongs Indicates the length of IP header in 32 bit words. Minimum length is 20 octets. Options may increase the size up to a maximum of 24 octets.
Type of Service (8 Bits)
Used for specifying special handling of packet. Has two sub-fields: Precedence TOS
IP Header…. P
P
P
D
T
Precedence 000-Routine 001-Priority 010-Immediate 011-Flash 100-Flash Override 101-CRITIC/ECP 110-Internetwork Control 111-Network Control
0
0
0
0
R
C
0
Delay 0-Normal 1-Minimise
Reliability 0-Normal 1-Maximise
Throughput 0-Normal 1-Maximise
0
0
0
Reserved: Always set to ‘0’
0
Cost 0-Normal 1-Minimise
= No TOS
IP Header…..
Total Length (16 Bits)
Specifies total length of the packet, including header, in octets Largest decimal number =216= 65535, the maximum possible size of an IP packet is 65535 octets Total length - header length = Packet’s data payload
Identification (16 Bits)
Each datagram is identified by a identification number set by the source. Normally incremented by 1 for each datagram sent.
IP Header……
Flags (3 Bits)
First bit is not used. Second bit is Don’t Fragment (DF) bit Third bit if More Fragment (MF) bit
Maximum Transmit Unit (MTU) is the size of the largest packet, including IP Header, that can be transmitted or received through a data link Default MTU is 576 bytes, which can be handled by any network without fragmentation
IP Header…… Fragment
Offset (13 Bits)
The fragmentation occurs at the routers, if the original packet length exceeds the MTU of a data link Used only in the cases when a datagram is fragmented on its way Specifies the offset, in units of eight octets, from the beginning of header to the beginning of the fragment Each fragment is marked, by router, with the same identifier number
Fragmentation.. MTU-1500
MTU-1500
MTU-576
172.16.2.0
172.16.3.0
1500 B IP
TCP
Data
512 B IP
IP
TCP
Data
DF=0; MF=1; Offset=0 IP
TCP IP
IP
512 B Data
DF=0; MF=1; Offset=64 Data TCP
Data Data
IP
476 B Data
DF=0; MF=0; Offset=128 Data
Fragmentation
Only the receiver host reassembles the datagram The destination machine starts a reassembly timer for about 60-120 seconds. If not all fragments were received, then hosts discard the packets and sends a time exceeded ICMP message to the source machine If a single fragment is lost during a transmission, the entire packet must be resent
IP Header…… Time
to live-TTL (8 Bits)
Assigns a life to an IP datagram
Protocol
Specifies the protocol that runs on the top of IP. TCP-6; EGP-8; UDP-17; OSPF-89
Header
(8 Bits)
Checksum (16 Bits)
Error detection field for IP header As each router decrements the TTL, checksum is calculated by each router
the
IP Header……. Source
Address of Host (32 Bits)
IP Address of the Originating Machine
Destination
Address of Host (32 Bits)
IP Address of the Destination Machine
Options
Security:
Strict Source Routing(SSR):
Specifies how secret the datagram is Gives the complete path to be followed
Loose Source Routing(LSR):
Gives the list of routers not to be missed
IP Header……..
Record Route:
Makes each router to append its IP address.
Time Stamp:
Makes each router to append its IP address and time stamp.
Padding
Ensures that the header ends on a 32 bit boundary by adding zeros after the option field.
Well known port numbers PORT
DESCRIPTION
20
File Transfer-Data
21
File Transfer-Control
23
Telnet
25
SMTP
53
Domain Name Server
69
Trivial File Transfer
80
WWW
123
Network Time Protocol
179
Border Gateway Protocol
Domain Name System (DNS) DNS Server What is the IP Address of www.Yahoo.com
What is the IP Address of www.Yahoo.com DNS Server
Internet User traffic
www.yahoo.com , IP address is 210.212.90.15
www.yahoo.com , IP address is 210.212.90.15
yahoo.com
ROUTING PROTOCOLS
Routing Protocol It
is a language a router speaks with other routers Functions of RP Forwarding, Sharing Updating
information about the reachability and status of the network
Static Routing Routes
to destinations are set up manually Route may be up or down but static routes will remain in the routing tables and traffic would still be sent towards the route Not suitable for large networks Also known as Non-adaptive routing
Dynamic Routing Routes
are learnt via an internal or external routing protocols Network reachability is dependent on the existence and state of the network Routing decisions change to reflect the changes in topology Also known as Adaptive routing
Routing Table A
Data base to be maintained by each router. Created by using algorithms. It contains Network address Interface address for reaching the next router (Hope) Metric
Types of R P Routes Static Distance Vector Protocols Dynamic
RIP,IGRP
Link State Protocols OSPF,IS-IS
Path Determination Router-A Network Router
Next Hop A
B 192.168.1. 0
192.168.7. 192.168.1.0 0 192.168.2.0 Direct 192.168.3.0 Direct 192.168.3. C 192.168.6. 0 0 192.168.4.0 B,C 192.168.4. 192.168.5. 192.168.5.0 B,C 0 0 192.168.6.0 B,C 192.168.7.0 B,C •Networks192.168.4.0 to 192.168.7.0 can be reached via either router B or C, which path is preferable? •Metrics are needed to rank the alternatives. 192.168.2. Direct 0
Routing Protocols contd.. Distance
Vector Routing Protocols
eg. RIP V1 (Routing Information protocol) RIP V2 Link
State Routing Protocols
eg. OSPF (Open Shortest Path First) IS-IS (Intermediate System-Intermediate System)
Metrics Hop
Cost
Count -- Distance Vector
(BW) – Link State
Routing Updates 20.0.0.10 20.0.0.0
A
21.0.0.0 .1
.2
Routing Table-A NW 20.0.0.0 21.0.0.0
VIA HOP ---------0 ---------0
22.0.0.0 21.0.0.2
1
23.0.0.0 21.0.0.2
2
After
B
.2
C
22.0.0.0 .1
.2
Routing Table-B NW 21.0.0.0 22.0.0.0
VIA HOP ---------0 ---------0
20.0.0.0 21.0.0.1 23.0.0.0 22.0.0.2
1 1
23.0.0.15 23.0.0.0 .1
Routing Table-C NW 22.0.0.0 23.0.0.0
VIA HOP ---------0 ---------0
21.0.0.0 22.0.0.1
1
20.0.0.0 22.0.0.1
2
exchanging 2 periodic updates, the network is converged.
Routing Updates 20.0.0.0 .2
Routing Table-A
A
.1
NW VIA HOP 20.0.0.0 D 0 21.0.0.0 D 0 22.0.0.0 21.0.0.2 1 23.0.0.0 21.0.0.2 UR 2
B
21.0.0.0
.1
.2
Routing Table-B
NW 20.0.0.0 21.0.0.0 22.0.0.0 23.0.0.0
C
22.0.0.0 .2
VIA HOP 21.0.0.1 1 D 0 D 0 22.0.0.2 UR 1
23.0.0.0 .1
Routing Table-C
NW 20.0.0.0 21.0.0.0 22.0.0.0 23.0.0.0
VIA HOP 22.0.0.1 2 22.0.0.1 1 D 0 D 0 C UR
Router-C in its next scheduled update, flags the network as unreachable and passes the information along.
Routing Updates 20.0.0.0 .2
Routing Table-A
A
.1
NW VIA HOP 20.0.0.0 D 0 21.0.0.0 D 0 22.0.0.0 21.0.0.2 1 23.0.0.0 21.0.0.2 2
B
21.0.0.0
.1
.2
Routing Table-B
NW 20.0.0.0 21.0.0.0 22.0.0.0 23.0.0.0
C
22.0.0.0 .2
VIA HOP 21.0.0.1 1 D 0 D 0 22.0.0.2 1
23.0.0.0 .1
Routing Table-C
NW 20.0.0.0 21.0.0.0 22.0.0.0 23.0.0.0
VIA HOP 22.0.0.1 2 22.0.0.1 1 D 0 D 0
Routers-A & B still have entries in the route table about 23.0.0.0. The information is no longer valid but there is no router to inform them of this fact, thus creating a black-hole in the network.
Route Invalidation Timer 20.0.0.0
A
.2
Routing Table-A
NW VIA HOP TIME 20.0.0.0 C 0 RIT 21.0.0.0 C 0 RIT 22.0.0.0 21.0.0.2 1 RIT 2 RIT 0 23.0.0.0 21.0.0.2 UR
21.0.0.0 .1
B
.2
Routing Table-B
C
22.0.0.0 .1
.2
NW VIA HOP TIME 20.0.0.0 21.0.0.1 1 RIT 21.0.0.0 C 0 RIT 22.0.0.0 C 0 RIT 1 RIT 23.0.0.0 22.0.0.2 UR 0
23.0.0.0 .1
Routing Table-C
NW VIA HOP TIME 20.0.0.0 22.0.0.1 2 RIT 21.0.0.0 22.0.0.1 1 RIT 22.0.0.0 C 0 RIT 23.0.0.0 C 0 RIT
Another Timer, Garbage Collection or Flush Timer, 60 Seconds longer than RIT, is set. On the expiry of which the route entry will be flushed from the routing table.
RIP Timers Update
30 Seconds
Route
Timer
Invalidation Timer
180 Seconds (6 Times the Update Timer)
Garbage
Collection Timer
240 seconds (60 Seconds longer than RIT)
LINK STATE ROUTING (OSPF) Sharing knowledge about the neighbourhood. Sharing with every other router in the area. Sharing when there is a change.
OSPF operation…. OSPF-
Routers send Hello packets out OSPF-enabled interfaces
Two
routers sharing a common link, after exchanging Hello packets, become neighbors
OSPF operation…
Link State Advertisements (LSAs) i.e. router’s links and their state, are exchanged between adjacent routers Each router receiving an LSA from a neighbor records the LSA in Link State Database and sends a copy of the LSA to all of its other neighbors LSAs are exchanged, until all the routers build identical Link State Databases i.e. the link state databases have been synchronized
OSPF operation….
Each router uses SPF algorithm to calculate a shortest path to every known destination, with itself as root Each router builds its router table from its SPF Tree After this, in a stable internetwork, all activities stop except
Hello packets are exchanged, after regular intervals of 10 seconds (Hello Interval) between neighbors, as keepalives LSAs are exchanged every 30 minutes
Metrics Speed
Cost
>= 100Mbps
1
Ethernet/802.3
10
E1(2.048Mbps)
48
64Kbps
1562
Metric=108/Interface Speed in bits per sec. e.g. 100000000/2048000=48.828125
Fully adjacent router network RA-RB-4 RA-RC-20 RA-RD-5 RB-RA-4 RB-RD-3 RC-RA-20 RC-RD-2 RD-RA-5 RD-RB-3 RD-RC-2
A
C RB-RA-4 RB-RD-3 RD-RA-5 RD-RB-3 RD-RC-2 RA-RB-4 RA-RC-20 RA-RD-5 RC-RA-20 RC-RD-2
4
A
C
2 5 0 2 0
4
5 2
2
tn+2 tn+1 tn
RB-RA-4 RB-RD-3 RA-RB-4 RA-RC-20 B RA-RD-5 RD-RA-5 3 RD-RB-3 3 RD-RC-2 D RC-RA-20 RC-RD-2
B
D RC-RA-20 RC-RD-2 RB-RA-4 RB-RD-3 RA-RB-4 RA-RC-20 RA-RD-5 RD-RA-5 RD-RB-3 RD-RC-2
Shortest Path Tree of Router-A 4
A
4
20 5
C
B
A
3 5
2 0 2
2
4
B
5
3
D
C
2
D
PATH VECTOR ROUTING Path vector routing is similar to distance vector routing. There is at least one node, called the speaker node, in each AS that creates a routing table and advertises it to speaker nodes in the neighboring ASs..
Boarder Gateway Protocol Between Two AS
Autonomous System Definition
An
autonomous system is a network under a common administration
Autonomous systems
Autonomous systems
AS-0
BG P AS-1
IGP
IGP
BG P
BG P
AS-2
IGP
Note: In distance vector routing, each node shares the knowledge about the entire AS with its immediate neighbors periodically .
Initial routing tables in path vector routing
Popular routing protocols
Stabilized tables for four autonomous systems
Administrative Distances Diversity
of metrics poses problems in routers running more than one routing protocol. Router may learn a route to the same destination from each of the protocols Administrative distances are the route sources to determine most preferred source Administrative distance is a measure of believability
Administrative Distances The
administrative distance of various protocols is as below: Connected
Interface - 0 Static Route -1 OSPF - 110 IS-IS - 115 RIP - 120 Unknown - 255 The lower the administrative distance, the more believable the protocol
Flow Chart of a Packet Packet Received NO If route available, search MAC in ARP cache
NO
Header & Checksum Valid YES
NO
Decrement TTL; TTL>=0
Send ICMP error message
YES
Send ARP request and wait for a response
Discard original Packet NO
YES
YES
YES
Route table lookup on Dest. Add.
Route Found
MAC Address Found
NO
Received ARP Reply
NO
Default route available YES
Build new packet with MAC address and route through port found in routing table
Received ARP reply, insert MAC and IP address into ARP table