CS 453 Computer Networks
-
Upload
acton-cummings -
Category
Documents
-
view
34 -
download
0
description
Transcript of CS 453 Computer Networks
CS 453CS 453Computer NetworksComputer Networks
Lecture 20Lecture 20
Layer 3Network LayerLayer 3Network Layer
Network Layer of the InternetNetwork Layer of the Internet
Internet – Network Layer
The Internet is a world-wide economic, social, educational and cultural force
It has literally changed the we conduct our daily lives
IP protocol is the foundation of the Internet It’s the glue that makes it all work
Internet – Network Layer
Design principles behind the IP protocol It has to work – build and test prototypes before
committing the standards Simplicity – don’t add unnecessary features and keep
the “necessary” ones to a minimum Don’t create options – have a way to do something,
not several ways Modularity – keep design in modules Deal with heterogeneity – complex networks are
going to mixes of technology – design for this
Internet – Network Layer
Design principles behind the IP protocol Negotiable parameters – allow devices to
negotiate parameters, don’t have fixed parameters
Don’t shoot for perfect – don’t try to deal with every possible wrinkle, strange requirements
Sender adheres to standard, receiver tries to adapt
Scalability – design must be scalable Cost/performance – must be within
acceptable limits
Internet
See previous diagram from Tanenbaum Interconnection of network
Across organizationsAcross countriesAcross continentsAcross oceans
IP Protocol is the common thread IP protocol was designed from its inception to
deal with networks of networks IP stands for internet protocol – with a little i
IPv4 Header
Header has 20 bytes of fixed fields
+ a variable length option part
Transmitted in Big-endian order
IPv4 HeaderHeader fields Version – 4 bits – identify the version of
datagram – lets routers know how to handle the packet
Header length – 4 bits because header has optional part length can vary, must declare header length – in N of 4 byte words – so max header length = 60 bytes
Type Of Service (TOS) – allows for differentiated services – low delay, high throughput – allows routes to decide what to do
IPv4 HeaderHeader fields Datagram length – length of entire datagram –
16 bits so max datagram length = 65,535, but usually 1500 or less (why?)
Identifier – 16 bits – ids the datagram, so devices will know which datagram fragments belong to
Flags – 3 bits – fragmentation flagsBit 16 = 0Bit 17 = DF (don’t fragment)Bit 18 = MF (more fragments coming)
IPv4 HeaderHeader fields Fragment offset – 13 bits – defines the
fragment’s slot in the datagram (for reassembly)
In 8 byte slots
8192 slots = max datagram = 65,536 Time to Live (TTL) – measures life of
datagram in router hops – each hop TTL-1If TTL reaches 0 datagram trashed and warning sent to source
IPv4 HeaderHeader fields Transport Layer Protocol – what transport
layer process should receive the datagram (TCP, UDP, …)
Header Checksum – calculated check sum but just for the header portion of the packet
Must be recalculated on each router hop Source address – 32 bit address of packet
source Destination address – 32 bit address of
packet destination recipient
IPv4 HeaderHeader fields
Option – variable length– intended to allow things not in the design Some predefined options originally – list has grown To see list go to
http://www.iana.org/assignments/ip_parameters
Option Description
Security Says routers should use secret routes
Strict source routing Define route to take
Loose source routing Defines part of route to take
Record route Record in route hops in options field
Timestamp Each router adds its address and timestamp
IP Addressing
All communications has a source and a destination (or more)
IP address scheme defines source and destination
IP address in IP Packet, not in frame
Each device on Internet has an IP address
Each address is unique – in theory (but not really)
IP Addressing
Each address represents a network interface …not a host
IP address has 32 bits…Represented (to us) in Dotted quad notation Dotted decimal notation
157.182.95.120
IP Addressing
But really it a string of bits157.182.95.120
So this is –
10011101.10110110.0101111.01111000
Which internally is –
1001110110110110010111101111000
IP AddressingClass addressing
Originally IP address were defined in terms of classes Since the 32 address defines all hosts/interfaces in
the Internet… … the Internet is a network of networks Fixed portion of the IP address were defined to
represent a network… …i.e. the first x bits The network address was defined on even octet
boundries --- 8 bits, 16 bits, 24 bitThe left x bits is the network addressThe right y bits is the host address x+y=32
IP AddressingClass addressing …was a bit of problem If WVU was assigned a Class B address (as it
was sometime ago……then the first 16 bits was the network address…the right 16 bits was for the address of all of the hosts in the network…and every host at WVU was on the the same network, right?…maybe for a few days
IP AddressingClass addressing We need someway of defining smaller
networks (subnets) for departments, buildings, etc.
And be able to aggregate these into the designated network (left x bits)
That is called classless addressing
IP AddressingClassless addressing Generalize the idea of classes, … but make them hierarchical …and arbitrary size ( number of bits) For example, suppose the left 16 bits
represent a network… …the next 8 bits represent network addresses
within that network – or subnets Since 8 bits can be left for the host address
part of the address There can be ? Hosts in such a subnet
IP AddressingClassless addressing At any given level an IP address needs to look
like a network address and a host address 157.182.95.120
At the highest network level –
157.182 is the network address
… and 95.120 is the host address…
But…
IP AddressingClassless addressing subnet mask A string of bits that acts as a bitmap Left x bits are set to 1 to say this many bit is
the network address Right x bit is set to 0 to say this many bits is
the host address…
11111111.11111111.11111111.00000000
Or…
255.255.255.0
IP AddressingClassless addressing This subnetting process can be done
recursively University gets a network
College creates a subnet
Department creates a subsubnet
Lab creates a subsubnet
IP AddressingClassless addressing Subnet mask is used as a bit mask ANDed with address to see if Address in in local network or .. Needs to be routed to another network
IP AddressingClassless addressing Subnet mask is used as a bit mask ANDed with address to see if Address in in local network or .. Needs to be routed to another network
IP Network Address Translation NAT
NAT NAT really irks a lot in the IP community Violates the IP unique address rule IP is connectionless, NAT creates a
connectionMust track state
Violates protocol layer conventionDips into IP header (port address)
Breaks on some protocols (payload imbedded addresses
Might not be able to scale to large subnet