internetworking, fragmentation, ipv4
TRANSCRIPT
Internetworking
• How Networks Differ
• How Networks Can Be Connected
• Concatenated Virtual Circuits
• Connectionless Internetworking
• Tunnelling
• Internetwork Routing
• Fragmentation
Connecting Networks
Internet
ATM WANSNASNA WAN
LLAN
Mainframes
LAN
LAN
LAN
FDDI
BUS LAN
Satellite Link
A collection of interconnected networks
How Networks Differ• Connection-oriented vs. Connectionless• Flat addressing vs. Hierarchical• Frame/Packet size (max)• Error handling and Flow control• Congestion control• Quality of Service• Security• Multicast/Broadcast, Etc.
How Networks Can Be Connected• Physical layer – hubs and repeaters signal amplification• Data link layer – bridges and switches protocol conversion, primitive routing, switching• Network layer – multiprotocol routers wide area routing, network protocol conversion.• Transport layer – transport gateways transport protocol conversion (TCP to SNA)• Application layer – application gateways
Concatenated Virtual Circuits
• Series of Virtual Circuits,• joined by Multiprotocol Routers• to make a long Virtual Circuit…..
Connectionless Internetworking
• Series of datagram networks• joined together at the network layer• by Multiprotocol Routers• to make larger datagram network.
Connectionless verses Connection oriented Internets
• Connection-oriented internetworks have much thesame problems as connection oriented subnets (what arethey?). But they also have the same disadvantages (whichare?).• Connection-oriented internetworks are difficult, ifnot impossible to run across datagram subnets.• Connectionless internetworks have much the samecharacteristics as connectionless subnets (which are?)• Connectionless internets can run across bothdatagram and virtual circuit subnets.
Tunnelling
• Put IP packets into Ethernet frames.• Multiprotocol router puts IP packets into WAN
packets and sends.• Multiprotocol router takes IP packets out of
WAN packets and puts in into Ethernet frames
Internetwork routing
Fragmentation
• Why fragmentation?• Transparent & Non-Transparent
fragmentation
G1 G2 G3 G4
Network 1Network 2
Packet Packet
G1 fragments a large packet
G2 reassembles the fragments
G3 refragments again
G4 reassembles again
Transparent Fragmentation
1) Gateway must know when it has received all the pieces
--Count field or “End of packet” bit
3) If Disjoint routs then performance lost
2) All packets must follow same route
4) Performance overhead
ATM requires fragmentation (segmentation)
Non-Transparent Fragmentation
G1 G2
Packet
G3 G4
G1 fragments a large packet
The fragments are not reassembled until the final destination is reached
1) Every host must be able to do reassembly
2) Overhead, as each fragment must have a header.
Fragmentation--When packet is fragmented, the fragments must be numbered in such a way that the original data stream can be reconstructed.
0
Gateway
0.0 0.1 0.2
Gateway
0.0.0 0.0.1 0.1.2
IP• IP --Internet Protocol• IP sends simple datagram over network• It provides unreliable & connection less delivery
service• Large packets may be fragmented & reassembled in
transmission• IP packet is transmitted in big endian order (i.e. From
left to right)
INTERNET PROTOCOL (IP) HEADER
Header
10101011101010101010010101010100101010100110100101010100101011111110100000111011111010000101110101010011010101111010000010100100000000010101000011010000111111010101......... 1011011001010100011001001010110
Data
IPv4 (internet protocol) header Normal size of IP header is 20 bytes plus Options
IP Header Fields• Version field keeps track of which version of the protocol
• IHL 4 bit field for Header Length . Gives how long the header is in 32 bit words. Minimum is 5, maximum is 15 which limits the header length to 60 bytes and thus options field to 40 bytes.
• Type of Service is 6 bit field, a three bit precedence field (i.e. Priority) & three flags, D, T & R (Delay, Throughput, Reliability).
• Total Length includes both header & data length. Maximum length is 65,536.
• Identification field is needed to allow the destination host to determine which datagram a newly arrived fragment belongs to.
• Flags is a 3 bit field. First bit is unused & then two 1 bit fields are DF & MF
• Fragment Offset tells where the current datagram this belongs to. 13 bits field so maximum 8192 fragments per datagram.
IP Header Fields• Time to Live field is a counter used to limit the packet lifetime
allowing maximum life time of 255 sec.• When the network layer has assembled a complete datagram ,
Protocol field tells it which transport process to give it to.
• Header Checksum verifies the header only. Useful for detecting errors.
• Source Address & Destination Address indicate network number & host number
• Option e.g. Route the packet must follow., Gives list of routers not to miss, Record Route, Timestamp
IP Address• Specifies both network and host• Current length is 32-bit, future length is 128
bit. It is also called as Dotted Decimal Format.
• General Syntax:- 4 components separated by dots, decimal numbers 0-255.
• E.g.18.26.0.1
network 32-bits host
0 NetID
10
110
1110 Multicast Address
HostID
HostID
AA
BB
CC
DD
8 bits 8 bits 8 bits8 bits
1111 Reserved for Future useEE
ClassClass
32 bits
IP Address
Information about Five IP address classes
Class Net id bits Host Bits Range Identification bits
A 7 24 0 - 126 0
B 14 16 128 - 191 10
C 21 8 192 - 223 110
D 28 0 224-239 1110
E 27 0 240-255 1111
This is also known as classful addressing scheme
Special IP Addresses
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 THIS host
0 0 0 0 0 0 0 0 0 0 0 HOST A host on this network
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Broadcast on the local Network
127 Anything Loopback
Network 1111111 ..... 111 Broad cast on distant network
SUBNETTo allow a single network address to span multiple physical networks is called subnet addressing or subnetting
Main Router
TO ISP
Ethernet
PC
COMP
IT
E&TC
MBA
MCA
Subnet Mask • A subnet mask (or number) is used to determine the
number of bits used for the subnet and host portions of the address.
• The mask is a 32-bit value that uses one-bits for the network and subnet portions and zero-bits for the host portion.
• The main router needs a subnet mask that indicates the split between network + subnet no. & host.
• Subnet mask is also written in dotted decimal format with addition of slash followed by the number of bits in the network + subnet part. E.g. 255.255.255.0/22
EXAMPLEs
10 Network Subnet Host
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 Subnet mask
e.g.
E.g.:- a packet addressed to 130.50.15.6 and arriving at the main router is ANDed with the subnet mask 255.255.252.0/22 to give the address 130.50.12.0
Thus subnetting reduces the router table space by creating the hierarchy of network, subnet, host.
Disadvantages of Classful Addressing
– Wasteful address architecture– Network boundaries are fixed at 8, 16 or 24 bits
(class A, B, and C)
ICMP (Internet Control Message Protocol)
• ICMP is an error reporting and network
management system.• ICMP attempts to keep the Internet running as efficiently as possible.• ICMP works to correct network problems,
although does not try to correct individual packet problems.
ICMP Packets
•Two levels of encapsulation that occur when an ICMP message is sent.
• ICMP packets are sent in IP Datagrams. They have no special priority,
ICMP Header ICMP Data Area
IP Header IP Data Area
Frame Header Frame Data
Area
•The ICMP message is encapsulated in a datagram, which is encapsulated in a frame for transmission across a physical network.
ICMP Header+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Type | Code | Checksum | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+• The Type field indicates the type of ICMP message.• The Code field provides data specific to the type.• The Checksum detects errors in the ICMP packet.
ICMP Message TypesMessage Type Description
Destination Unreachable Packet could not be delivered
Time exceeded Time to live field hits to 0
Parameter Problem Invalid header field
Source Quench Choke packet
Redirect Teach a router about geography
Echo Ask machine if it is alive
Echo reply Yes, I m alive
Timestamp request Echo request with time stamp
Timestamp reply
Some Uses for ICMP1. Echo (ping)2. Tells the source a packet exceeded the TTL.3. Tell the source that a packet had to be fragmented.4. Redirect the host to a better router.5. Controls the rate at which a host sends packets.(Source
Quench)6. Tell the source the destination is unreachable. Either the
network or the host is down.7. Request subnet mask.
ARP (Address Resolution Protocol)
• Mapping between a protocol address & a hardware address is called resolution.
• In computer networking, the Address Resolution Protocol (ARP) is the method for finding a host's link layer (hardware) address when only its Internet Layer (IP) or some other Network Layer address is known
32
NetworkLayer
Link Layer
IP
ARP NetworkAccess RARP
Media
ICMP IGMP
TransportLayer
TCP UDP
Overview
33
ARP and RARP• Note:
– The Internet is based on IP addresses – Data link protocols (Ethernet, FDDI, ATM) may have
different (MAC) addresses
• The ARP and RARP protocols perform the translation between IP addresses and MAC layer addresses
RARP
Ethernet MACaddress(48 bit)
ARPIP address(32 bit)
34
Processing of IP packets by network device drivers
loopbackDriver
IP Input
Put on IPinput queue
ARPdemultiplex
Ethernet Frame
Ethernet
IP destination of packet= local IP address ?
IP destination = multicastor broadcast ?
IP Output
Put on IPinput queue
No: get MACaddress withARP
ARPPacket
IP datagram
No
Yes
YesEthernet
Driver
35
Address Translation with ARP
ARP Request: Argon broadcasts an ARP request to all stations on the network: “What is the hardware address of Router137?”Argon
128.143.137.14400:a0:24:71:e4:44
Router137128.143.137.1
00:e0:f9:23:a8:20
ARP Request:What is the MAC addressof 128.143.71.1?
36
Address Translation with ARP
ARP Reply: Router 137 responds with an ARP Reply which contains the hardware addressArgon
128.143.137.14400:a0:24:71:e4:44
Router137128.143.137.1
00:e0:f9:23:a8:20
ARP Reply:The MAC address of 128.143.71.1is 00:e0:f9:23:a8:20
37
ARP Packet Format
Hardware type (2 bytes)
Hardware addresslength (1 byte)
Protocol addresslength (1 byte)
Operation code (2 bytes)
Target hardware address*
Protocol type (2 bytes)
Source hardware address*
Source protocol address*
Target protocol address*
* Note: The length of the address fields is determined by the corresponding address length fields
Sending an ARP Message
ARP Message
Frame Header
Frame Data Area CRC
39
• ARP Request from Argon: Source hardware address: 00:a0:24:71:e4:44Source protocol address: 128.143.137.144Target hardware address: 00:00:00:00:00:00Target protocol address: 128.143.137.1
• ARP Reply from Router137: Source hardware address: 00:e0:f9:23:a8:20 Source protocol address: 128.143.137.1 Target hardware address: 00:a0:24:71:e4:44Target protocol address: 128.143.137.144
ARP CACHE-Since sending an ARP request/reply for each IP datagram is inefficient, hosts
maintain a cache (ARP Cache) of current entries. The entries expire after 20 minutes.
40
Things to know about ARP• What happens if an ARP Request is made for a non-existing host?
Several ARP requests are made with increasing time intervals between requests. Eventually, ARP gives up.
• On some systems (including Linux) a host periodically sends ARP Requests for all addresses listed in the ARP cache. This refreshes the ARP cache content, but also introduces traffic.
• Gratuitous ARP Requests: A host sends an ARP request for its own IP address:– Useful for detecting if an IP address has already been assigned.
• All IP addresses have a network and host portion. In classful addressing, the network portion ends on one of the separating dots in the address (on an octet boundary). Classless addressing uses a variable number of bits for the network and host portions of the address.
• • Decimal 192 160 20 48 Binary 11000000 10100000 00010100 0011 0000 <-------- 28 bits
Network -------> 4 bits host Classful addressing divides an IP address into the Network and Host portions along octet boundaries. Classless addressing treats the IP address as a 32 bit stream of ones and zeroes, where the boundary between network and host portions can fall anywhere between bit 0 and bit 31. The network portion of an IP address is determined by how many 1's are in the subnet mask. Again, this can be a variable number of bits, and although it can fall on an octet boundary, it does not necessarilly need to. A subnet mask is used locally on each host connected to a network, and masks are never carried in IPv4 datagrams. All hosts on the same network are configured with the same mask, and share the same pattern of network bits. The host portion of each host's IP address will be unique.
•
CIDR (Classless InterDomain Routing)• The rapid growth in the size of the global Internet’s routing
tables
• The eventual exhaustion of the 32-bit IPv4 address space
• CIDR eliminates the traditional concept of Class A, Class B, and Class C network addresses.
NAT (Network Address Translation)
• = temporary binding and address/port rewriting in IP and L4 packet headers– table of (internal 5-tuple, external 5-tuple)– must allow unique mapping of return packets
• Typically uses private address space– 10.0.0.0/8, 172.16.0.0-172.31.0.0., 192.168.0.0/24– 169.254.0.0/16 reserved for automatic IP addressing
• Designed for client-server TCP applications with short session lifetimes– = web, email retrieval
• Binding is temporary (minutes)– causes failures for long-lived applications– application-layer “keep-alives” in ssh, IMAP, SIP, …