Post on 11-Jan-2016
Review of IPv4 Routing
Dr Ram P Rustagi, PESITrprustagi@pes.edu
Jun 06, 2013
http://ise.pesit.pes.edu/Workshops/CDoT/
2
IPv4 Overview
• Resources
2
Network service modelQ: What service model for “channel” transporting datagrams from sender to receiver?
•Can transport layer rely on n/w layer?
•Will the packets be in order?
•Will the time gap between two pkts be maintained?
•Will network provide any congestion information?
•Will network provide any time gurantees?
•will network provide any BW guarantees?
Network Layer4-17
1
23
Datagram forwarding table
IP destination address in arriving packet’s header
routing algorithm
local forwarding table
dest address output link
address-range 1address-range 2address-range 3address-range 4
3221
4 billion IP addresses, so rather than list individual destination addresslist range of addresses(aggregate table entries)
src: Kurose & Ross
Review of IPv4
• General IP Networking Overview– Network Configuration– IPv4 Addressing * 1981 IP was standardized * Dotted Decimal Notation * Classful addressing - wastage
IP Addressing Classful addressing:
first byte value determines the class Class A (unicast): first bit is 0.
• value of first byte 0 - 126
Class B (unicast): first 2 bits have value 10• value of first byte: 128 - 191
Class C (unicast): first 3 bits have value 110• value of first byte: 191 - 223
Class D (Multicast): First 4 bits have value: 1110
• value of first byte: 224 - 239
Class E (Experimental) : First 4 bits have value: 1111
• value of first byte: 240 - 255
Large part of address space is wasted
Growth of the Internet
• In 1985 (RFC 950) subnetting concept was introduced.
• In 1987 VLSM (RFC 1009)• It uses longest prefix match• It allows Route aggregation
Subnet Address HierarchyExtended-Network-Prefix
Growth of the Internet
• By 1992 IETF identified the exponential growth of the internet.
• Three serious problems - Exhaustion of Class B address space - Rapid growth of Backbone Routing tables - Exhaustion of 32 bit IPv4 address space
• In 1993 CIDR was officially documented - Supernetting - Extensively supports Route aggregation
• IETF started the IPng working group for IPv6
IP Addressing IPv4 addresses are unique and universal
exceptions ? IPv4 address is 32 bit long
total available addresses: 4,294,967,296 Uses Dotted Decimal Notation (DDN)
example: 119.82.126.182 Exercise:
Find the error in following addresses• 119.082.126.182
• 119.82.126.182.80• 119.82.126.282• 119.01010010.126.82
Subnets Identified by subnet masks Defines one network A router is needed to connect two networks Masks for classful addresses
Class A: 255.0.0.0 or /8 Class B: 255.255.0.0 or /16 Class C: 255.255.255.0 or /24
Glassful addressing obsolete now replaced with classless addressing (CIDR)
RFCs RFC 1518: Architecture for IP addr allocation
with CIDR RFC 1466: Guidelines for IP addr space
management RFC 917: Internet subnets
Subnets Few terms to understand
network portion and host portion network number
• apply subnet mask to IP address (bitwise AND)
Broadcast address• set all bits to 1 in host portion
network mask• set all bits to 0 in host portion
first available address in the block• value of host portion = 1
last available address in the block• value of host portion = 2n-2
Subnets Exercise 1
a block of addresses is granted to a small organization. one of the address is 119.82.126.182/27. Find out the following:
• the network number• subnet mask• broadcast address• first available address and • last available address
Exercise 2: repeat the above exercise for address
• 192.168.100.200/18
Address Types
Unicast Multicast Broadcast Anycast
Forwarding Table Needs at least 4 entries in forwarding table
Network Address Network Mask Next Hop Address Interface
Forwarding table principles Each routers makes its decision independently Different routers may have different information Tells how to reach destination but not how to get back
Effect of Forwarding Table principles Packets are forwarded on hop by hop basis Packets from A to B go via path X but return via path Y
223.1.1.1
223.1.1.3
223.1.1.4
223.1.2.2223.1.2.1
223.1.2.6
223.1.3.2223.1.3.1
223.1.3.27
223.1.1.2
223.1.7.2
223.1.7.1
223.1.8.2223.1.8.1
223.1.9.1
223.1.9.2R1
R3R2
Rest of Internet
Exercise: Build the routing table for all the routers
Note: Take subnet mask for all network as /24
Q: What should be routing table for PCs?
Forwarding Table
e1e2
e3e2
e1e3
e3e2
e1
src: Kurose & Ross
Network Layer4-53
Hierarchical addressing: route aggregation
“Send me anythingwith addresses beginning 200.23.16.0/20”
200.23.16.0/23
200.23.18.0/23
200.23.30.0/23
Fly-By-Night-ISP
Organization 0
Organization 7Internet
Organization 1
ISPs-R-Us“Send me anythingwith addresses beginning 199.31.0.0/16”
200.23.20.0/23
Organization 2
.
..
..
.
hierarchical addressing allows efficient advertisement of routing information:
src: Kurose & Ross
Route Aggregation
200.23.16.0/23
11001000 00010111 00010000 00000000
200.23.18.0/23
11001000 00010111 00010010 00000000
200.23.20.0/23
11001000 00010111 00010100 00000000
200.23.22.0/23
11001000 00010111 00010110 00000000
200.23.24.0/23
11001000 00010111 00011000 00000000
200.23.26.0/23
11001000 00010111 00011010 00000000
200.23.28.0/23
11001000 00010111 00011100 00000000
200.23.30.0/23
11001000 00010111 00011110 00000000
Exercise: Summary Route
Summary Route ?
Design the subnetting/routing
N/w given: 192.168.0.0/24-Each LAN has 10 hosts-serial link n/w needs two addresses-LAN of R3-R7-R6 needs 3 addresses
Answer: subnetting exercise
• 9 LANs of 10 hosts• 1 LAN of 3 addresses• 8 Serial links of 2 addresses
Using Routing Table For a given packet
take the destination address repeat the following for each entry in routing
table apply the netmask match the computed n/w number with routing
table entry if matches
• forward the packet to next-hop on listed interface• exit
else • continue to next entry
when no match found (assuming 0.0.0.0/0 not defined)
• drop the packet
Network Layer4-55
IP addressing: the last word...
Q: how does an ISP get block of addresses?A: ICANN: Internet Corporation for Assigned Names and Numbers http://www.icann.org/
allocates addresses manages DNS assigns domain names, resolves disputes
ARP - Address Resolution Protocol Packet delivery to a host requires two
addresses• Logical address - IP Address• Physical address - MAC address
Need to find mapping from logical to physical
• ARP is used - RFC 826
Fig Src: Forouzan - Data Communication and Networking, SIE
ARP - 4 cases
Src: Forouzan
ARP ARP Request and Reply
ARP Request is broadcast ARP Reply is Unicast
Other forms of ARP Proxy ARP (RFC 1027) Reverse ARP (RFC 903) Gratuitous ARP
Proxy ARP Router (Proxy ARP Server) replied to all requests Used when
splitting a network w/o changing hosts netmask Taking care of statically configured m/c Mobile IP
Src: Forouzan
Reverse ARP Reverse ARP (RARP)
RFC 903 Used for diskless stations Organization does not have enough IP
Address Target as MAC Bcast does not cross the
router Needs one RARP server for each subnet
BOOTP Improvement over RARP Has a relay agent to forward across network has static mapping of MAC to IP
• manageability issues
DHCP - replaces BOOTP
Gratuitous ARP Ref: http://wiki.wireshark.org/Gratuitous_ARP Gratuitous ARP Request
both src and dstn IP is set to that of m/c dstn MAC is broadcast i.e. ff:ff:ff:ff:ff:ff
Ordinarily, no reply will occur normally•if a m/c exists, it may respond
Gratuitous ARP Reply a reply to which no request has occurred
Gratuitous ARP
Why Gratuitous ARP help detect IP conflicts
•if a m/c receives G-ARP req which is its own, implies IP conflict
helps in updating other m/cs ARP tables•used in clustering solutions, when IP is
moved helps inform the switch to update its port
table each time an i/f comes up (after down),
sends G-ARP Practice: use send_arp to perform gratuitous
arp
Network Setup
• We are not using the backbone network - better delete the address 172.16.3.x/21
– These are backbone addresses (College network)• with default gateway of 172.16.3.1
• Should we not use commands like ifconfig, route, arp etc.– These are deprecated commands, use commands from
iproute2 pkg.• ip addr [options]• ip route [options]• ip neigh [options]
Utilities/Tools
• wireshark/tcpdump• nc• ping• arping
Wireshark • It is a network packet analyser• In late 1997 Gerald Combs started writing Ethereal
for his use• 1998 version 0.2.0 was released• later several patches, plug-ins were added • In 2006 it is renamed as wireshark• Users - Administrators - Security Engineers - Developers - Ordinary users
Wireshark
Main window: Main menu bar The main toolbar The filter toolbar (Display filter) The packet list pane The packet details pane The packet byte pane The status bar
Wireshark capture
Utilities/Tools
• Go to capture option• Specify the interface• Specify the capture filter (otherwise you will get too
much traffic)• Examples of good capture filters
– for capturing a traffic for a given network or networks• net 172.16.1.0/24 or 172.16.2.0/24
– for capturing specific source and/or destination• src 172.16.1.201 and dst 172.16.3.201
– for capture specific protocol or applications or TCP/UDP port no• http• port 80 or port 8080
Utilities/Tools
• Difference between the capture filter and the display filter– Capture filters are used for capturing only relevant
packets– display filters are used for displaying selected packets
from what is captured.• these may be used to analyze a subset of packets
e.g. – packets on a TCP Connection– looking at only TCP SYN/RST packets etc
• We can save captured data and analyse• To check the connectivity we can use ping
command with –c N option
37
Utilities/Tools
• netcat (nc) – to send packets on the network– supports both udp and tcp– can act as a client and server as well– data is to be specified by the user
• can be piped from other programs (or files)– example of connecting using UDP– example of connecting using TCP
37
Summary
• Growth of internet• IPv4 addressing• IPv4 Routing• Building IPv4 network• Analysis
Thank You