Networks - an overview fileNetworks anoverview KarstKoymans Informatics Institute University of...
Transcript of Networks - an overview fileNetworks anoverview KarstKoymans Informatics Institute University of...
Networksan overview
Karst Koymans
Informatics InstituteUniversity of Amsterdam
(version 1.5, 2011/02/03 12:07:08)
Monday, January 31, 2011
Karst Koymans (UvA) Networks Monday, January 31, 2011 1 / 52
1 Network modelingLayered networksNetworks as graphsAddressing in graphs
2 RoutingBasic RoutingLocations and EndpointsIP addressingSubnettingIPv6 addressing
3 Packet formatsIPv4 packetsIPv6 packets
Karst Koymans (UvA) Networks Monday, January 31, 2011 2 / 52
Network modeling
Outline
1 Network modelingLayered networksNetworks as graphsAddressing in graphs
2 RoutingBasic RoutingLocations and EndpointsIP addressingSubnettingIPv6 addressing
3 Packet formatsIPv4 packetsIPv6 packets
Karst Koymans (UvA) Networks Monday, January 31, 2011 3 / 52
Network modeling Layered networks
Outline
1 Network modelingLayered networksNetworks as graphsAddressing in graphs
2 RoutingBasic RoutingLocations and EndpointsIP addressingSubnettingIPv6 addressing
3 Packet formatsIPv4 packetsIPv6 packets
Karst Koymans (UvA) Networks Monday, January 31, 2011 4 / 52
Network modeling Layered networks
OSI model
Obligatory 7-layer view, in particular for TCP/IP
Link layer (2): switching
mostly connectionless (Ethernet)
Network layer (3): routing
connectionless (IP)
Transport layer (4)
connection-oriented on layer 4 (TCP)
also connectionless on layer 4 (UDP)
Karst Koymans (UvA) Networks Monday, January 31, 2011 5 / 52
Network modeling Layered networks
Interfaces and Protocols
InterfacesSame computer
Different layer
Vertical: SDU
(Service Data Unit)
via SAP
(Service Access Point)
to/from lower layer
ProtocolsDifferent computer
Same layer
Horizontal: PDU
(Protocol Data Unit)
to/from peer
mostly through a
lower layer
Karst Koymans (UvA) Networks Monday, January 31, 2011 6 / 52
Network modeling Layered networks
Headers, PDU encapsulation and multiplexing
Layer N adds control (header/trailer/...) to Layer N+1
Encapsulation
Multiplexing
Demultiplexing
Decapsulation
Karst Koymans (UvA) Networks Monday, January 31, 2011 8 / 52
Network modeling Networks as graphs
Outline
1 Network modelingLayered networksNetworks as graphsAddressing in graphs
2 RoutingBasic RoutingLocations and EndpointsIP addressingSubnettingIPv6 addressing
3 Packet formatsIPv4 packetsIPv6 packets
Karst Koymans (UvA) Networks Monday, January 31, 2011 9 / 52
Networks with a WAN-connection“The Internet”
Host
Network Network
HostRouter
Host
Network Network
HostRouter
LinkWAN
Network modeling Addressing in graphs
Outline
1 Network modelingLayered networksNetworks as graphsAddressing in graphs
2 RoutingBasic RoutingLocations and EndpointsIP addressingSubnettingIPv6 addressing
3 Packet formatsIPv4 packetsIPv6 packets
Karst Koymans (UvA) Networks Monday, January 31, 2011 14 / 52
Network modeling Addressing in graphs
Addresses
Missing in the pictures are some fundamental concepts
AddressesLocators
Used in routing
Explicit network elementsAs nodes
Not as edges
Karst Koymans (UvA) Networks Monday, January 31, 2011 15 / 52
Host with interface
Host
The host has an interface
The interface has an address
The host is the endpoint
Routing
Outline
1 Network modelingLayered networksNetworks as graphsAddressing in graphs
2 RoutingBasic RoutingLocations and EndpointsIP addressingSubnettingIPv6 addressing
3 Packet formatsIPv4 packetsIPv6 packets
Karst Koymans (UvA) Networks Monday, January 31, 2011 21 / 52
Routing Basic Routing
Outline
1 Network modelingLayered networksNetworks as graphsAddressing in graphs
2 RoutingBasic RoutingLocations and EndpointsIP addressingSubnettingIPv6 addressing
3 Packet formatsIPv4 packetsIPv6 packets
Karst Koymans (UvA) Networks Monday, January 31, 2011 22 / 52
Routing Basic Routing
Basic “routing”
Delivering packets to an address
Using a number of hops through intermediate networks
(using wires, air, devices,. . . )
Can be done at all layers, not only the network layer
Based on table lookup of next hop
Examples
IP packet routing
Ethernet frame switching
MPLS label switching
Karst Koymans (UvA) Networks Monday, January 31, 2011 23 / 52
Routing Locations and Endpoints
Outline
1 Network modelingLayered networksNetworks as graphsAddressing in graphs
2 RoutingBasic RoutingLocations and EndpointsIP addressingSubnettingIPv6 addressing
3 Packet formatsIPv4 packetsIPv6 packets
Karst Koymans (UvA) Networks Monday, January 31, 2011 24 / 52
Routing Locations and Endpoints
Locations versus endpoints
Addresses are the locators for locations
They are the names for the locations
Names for endpoints are missing
Hosts, processes, communication endpoints
Is this an architectural flaw?
Karst Koymans (UvA) Networks Monday, January 31, 2011 25 / 52
Routing Locations and Endpoints
Comparison: Overloading of A records in DNS
Host with multiple interfaces. . .
Overloaded A records
router.students.os3.nl. A 145.100.102.1
router.studlab.os3.nl. A 145.100.104.1
router.os3.nl. A 145.100.102.1
A 145.100.104.1
Corresponding PTR records
1.102.100.145.in-addr.arpa. PTR router.students.os3.nl.
1.104.100.145.in-addr.arpa. PTR router.studlab.os3.nl.
Karst Koymans (UvA) Networks Monday, January 31, 2011 26 / 52
Routing IP addressing
Outline
1 Network modelingLayered networksNetworks as graphsAddressing in graphs
2 RoutingBasic RoutingLocations and EndpointsIP addressingSubnettingIPv6 addressing
3 Packet formatsIPv4 packetsIPv6 packets
Karst Koymans (UvA) Networks Monday, January 31, 2011 27 / 52
Routing IP addressing
IP (layer 3) addresses
IP version 432 bit addresses
Network part (first), host part (last)
Decimal dotted notation 145.100.102.1
Karst Koymans (UvA) Networks Monday, January 31, 2011 28 / 52
Routing IP addressing
Address classes
Definition (IP address)An IP address is a function f : 32 → 2(= {0, 1})
Class A: f (0) = 0; f (0), . . . , f (7) network part
Class B: f (0) = 1; f (1) = 0, f (0), . . . , f (15) network part
Class C: f (0) = f (1) = 1; f (2) = 0, f (0), . . . , f (23) network part
Class D: f (0) = f (1) = f (2) = 1; f (3) = 0 multicast
Class E: f (0) = f (1) = f (2) = f (3) = 1 reserved
Karst Koymans (UvA) Networks Monday, January 31, 2011 29 / 52
Routing IP addressing
Special addresses
Definition (Special addresses; see also RFC 5735)
0.0.0.0 IP address unknown
127.0.0.1 loopback address (anycast?)
Host part all 0 Network identification
Host part all 1 Directed broadcast
255.255.255.255 Local broadcast
Karst Koymans (UvA) Networks Monday, January 31, 2011 30 / 52
Routing IP addressing
Private addresses
Definition (Private addresses (RFC 1918, RFC 3927))
Class Address Range # of nets CIDR notation
A 10.0.0.0-10.255.255.255 1 10.0.0.0/8
B 172.16.0.0-172.31.255.255 16 172.16.0.0/12
C 192.168.0.0-192.168.255.255 256 192.168.0.0/16
B 169.254.0.0-169.254.255.255 1 169.254.0.0/16
(Link local dynamic configuration)
Karst Koymans (UvA) Networks Monday, January 31, 2011 31 / 52
Routing Subnetting
Outline
1 Network modelingLayered networksNetworks as graphsAddressing in graphs
2 RoutingBasic RoutingLocations and EndpointsIP addressingSubnettingIPv6 addressing
3 Packet formatsIPv4 packetsIPv6 packets
Karst Koymans (UvA) Networks Monday, January 31, 2011 33 / 52
Routing Subnetting
Subnetting
Original RFC 950 subnetting
Only one level of subnets
All subnets are the same size (RIPv1 friendly)
Subnets all-zeroes and all-ones are not allowed
This has been obsoleted in the all-CIDR era
Example subnet schemeDivide the class B net 145.18.0.0/16 into 254 “class C nets”
145.18.1.0/24,. . . , 145.18.254.0/24
Karst Koymans (UvA) Networks Monday, January 31, 2011 34 / 52
Routing Subnetting
Masks
Not necessarily contiguous according to RFC 950
Silly subnetting exampleNetmask 255.255.255.88 (in a class C scenario)
88 = 01011000
6 (explain. . . ) subnets with 30 (explain. . . ) hosts each
This is really obsolete, because humans can’t handle it well
Nowadays masks are contiguous (33 options)
All-zeroes and all-ones subnets are allowed
Karst Koymans (UvA) Networks Monday, January 31, 2011 35 / 52
Routing Subnetting
Possible Masks
Definition (Possible masks)
Prefix length Subnet mask CIDR notation (for first non-zero net)
0 0.0.0.0 0.0.0.0/0
1 128.0.0.0 128.0.0.0/1
2 192.0.0.0 64.0.0.0/2
. . . . . . . . .
31 255.255.255.254 0.0.0.2/31
32 255.255.255.255 0.0.0.1/32
Karst Koymans (UvA) Networks Monday, January 31, 2011 36 / 52
Routing Subnetting
Variable Length Subnet Masks
Definition (VLSM)Variable length subnet masks (VLSM) is the idea to use subnets that are
not necessarily all the same size.
Not possible with RIPv1
Subnets can be subnetted again, and again, and again
Used to organize and subdivide larger organizations
(universities, enterprises)
Karst Koymans (UvA) Networks Monday, January 31, 2011 37 / 52
Routing Subnetting
CIDR
Definition (CIDR)Classless Inter-Domain Routing (CIDR) is the idea to put the division
between network part and host part of addresses on arbitrary bit positions,
not only on 8, 16 or 24 bit positions as in classful A/B/C-networks.
This idea comes from the need for supernetting
It is also used to aggregate routes
Routing is based on longest match (which is most specific)
A-, B-, C-classes are abandoned
Together with VLSM, the difference between
network and subnetwork disappears.Karst Koymans (UvA) Networks Monday, January 31, 2011 38 / 52
Routing Subnetting
Point to Point links
Usually the interfaces at both ends each have an IP address
Often a /30 is used for that
Point to Point links may be unnumbered
Or may use a /31 (RFC 3021)
Or may use two /32’s (within PPP, RFC 1332)
Karst Koymans (UvA) Networks Monday, January 31, 2011 39 / 52
Routing IPv6 addressing
Outline
1 Network modelingLayered networksNetworks as graphsAddressing in graphs
2 RoutingBasic RoutingLocations and EndpointsIP addressingSubnettingIPv6 addressing
3 Packet formatsIPv4 packetsIPv6 packets
Karst Koymans (UvA) Networks Monday, January 31, 2011 40 / 52
Routing IPv6 addressing
IPv6 addresses
IP version 6
128 bit addresses
4 times as many bits as IPv4
296 times as many addresses
Much more hierarchical addressing
See also the IPv6_intro presentation
Karst Koymans (UvA) Networks Monday, January 31, 2011 41 / 52
Packet formats
Outline
1 Network modelingLayered networksNetworks as graphsAddressing in graphs
2 RoutingBasic RoutingLocations and EndpointsIP addressingSubnettingIPv6 addressing
3 Packet formatsIPv4 packetsIPv6 packets
Karst Koymans (UvA) Networks Monday, January 31, 2011 42 / 52
Packet formats IPv4 packets
Outline
1 Network modelingLayered networksNetworks as graphsAddressing in graphs
2 RoutingBasic RoutingLocations and EndpointsIP addressingSubnettingIPv6 addressing
3 Packet formatsIPv4 packetsIPv6 packets
Karst Koymans (UvA) Networks Monday, January 31, 2011 43 / 52
IPv4 header
0 3 4 7 8 15 16 18 19 31
Version IHL Type of Service Total Length
Identification Flags Fragment offset
Time to Live Protocol Header Checksum
Source IP
Destination IP
Options (optional; padded)
Packet formats IPv4 packets
IPv4 header fields
IPv4 header fields
Version 4
IHL Total header length in 32-bit words (5-15)
Type of Service Now used for DiffServ and ECN
Total Length Including header, in bytes (max 65535)
Identification Used with fragmentation
Flags DF (Don’t Fragment) and MF (More Fragments)
Fragment offset First packet has offset 0
Karst Koymans (UvA) Networks Monday, January 31, 2011 45 / 52
Packet formats IPv4 packets
IPv4 header fields (continued)
IPv4 header fields (continued)
Time to Live Really a hop count
Protocol Upper layer protocol differentiation
Header Checksum One’s complement of one’s complement sum
Source Address IP address of sender
Destination Address IP address of receiver
Options Source routing, timestamp, . . .
Karst Koymans (UvA) Networks Monday, January 31, 2011 46 / 52
Packet formats IPv4 packets
Protocol
Common protocols
1 ICMP
2 IGMP
4 IP in IP
6 TCP
17 UDP
89 OSPF
Less common protocols
41 IPv6 in IP
46 RSVP (IntServ)
47 GRE
111 IPX in IP
115 L2TP
132 SCTP
Karst Koymans (UvA) Networks Monday, January 31, 2011 47 / 52
Packet formats IPv6 packets
Outline
1 Network modelingLayered networksNetworks as graphsAddressing in graphs
2 RoutingBasic RoutingLocations and EndpointsIP addressingSubnettingIPv6 addressing
3 Packet formatsIPv4 packetsIPv6 packets
Karst Koymans (UvA) Networks Monday, January 31, 2011 48 / 52
Packet formats IPv6 packets
IPv6 header0 3 4 11 12 15 16 23 24 31
Vers. Traffic Class Flow Label
Payload Length Next Header Hop Limit
Source Address
Destination Address
Karst Koymans (UvA) Networks Monday, January 31, 2011 49 / 52
Packet formats IPv6 packets
IPv6 header fields
IPv6 header fields
Version 6
Traffic Class Type of Service management
Flow Label Identify flows with special requirements
Payload Length Including extension headers
Next Header Type of following header
Hop Limit Forwarding count and loop protection
Source Address IPv6 address of sender
Destination Address IPv6 address of recipient
Karst Koymans (UvA) Networks Monday, January 31, 2011 50 / 52
Packet formats IPv6 packets
Next HeaderProtocol type
Header types
Number Name Meaning
0 HOPOPT Hop-by-hop Option
6 TCP Upper layer Transmission Control
17 UDP Upper layer User Datagram
41 IPv6 IPv6 (in IPv6)
43 IPv6-Route Routing Header
44 IPv6-Frag Fragment Header
Karst Koymans (UvA) Networks Monday, January 31, 2011 51 / 52
Packet formats IPv6 packets
Next Headerprotocol type
Header types (continued)
Number Name Meaning
50 ESP Encap Security Payload
51 AH Authentication Header
58 IPv6-ICMP ICMP for IPv6
59 IPv6-NoNxt No Next Header
60 IPv6-Opts Destination Options
See http://www.iana.org/assignments/protocol-numbers
Karst Koymans (UvA) Networks Monday, January 31, 2011 52 / 52