Networking 1
Mobile Communications
Fundamental Networking
Manuel P. Ricardo
Faculdade de Engenharia da Universidade do Porto
Networking 2
♦ What networking concepts shall I have present from previous courses?
♦ What are the differences between L2 and L3 networks?
♦ What is a tunnel? What is a virtual network? Why are they relevant?♦ What is a tunnel? What is a virtual network? Why are they relevant?
♦ What are the differences between IPv6 and IPv4?
Networking 3
Switching: Circuits, Virtual Circuits, Datagram
Networking 4
Circuit Switching
♦ Technologies: ISDN: Basic Rate Access, E1 Ł time slots for 64 kbit/s channels
♦ Path defined during call establishment, based on the called number
♦ Switching
» Exchange of time slots
» In time and in space
» Inputs required to be synchronised
Networking 5
Virtual Circuit Switching
♦ Technologies: ATM, MPLS
♦ Path
» defined during the virtual circuit establishment
» Defined as a set of nodes, ports, labels
♦ Switching
» Cells, packets
» Exchange of labels» Exchange of labels
Tabela de translação de
portas / canais virtuais
1
M
a
t
1
N
2
t
Entrada
M
abc
yzc
1N2
21N
kh
m
nng
Saída
1
Porta CV Porta CV
comutação
espacial
comutação
de etiqueta
b c c
y c z y
controlo de
comutação
g h
n
k kn
m
g
cabeçalho
dados
a, b, c, ... indicador de canal virtual
b a
Networking 6
Packet Switching
♦ Technologies: Ethernet, IP
♦ Path defined by packet destination address
Networking 7
To Think About
♦ Suppose terminal a moves from port 2 to port 1
» What needs to be done so that terminal a can continue receiving packets?
Networking 8
L2 Networking – Frame Formats
Ethernet
7x 10101010 10101011
Protocolo=IP
PPPBit stuffing – 5 1s seguidos ŁŁŁŁ emissor introduz 0
Networking 9
L2 Networking - Bridges
♦ Bridge builds forwarding tables automatically
♦ Address learning
» Source Address of received frame is associated to a bridge input portŁ station reachable through that port
♦ Frame forwarding♦ Frame forwarding
» When a frame is received, its Destination Address is analysed– If address is associated to a port à frame forwarded to that port
– If not à frame transmitted through all the ports but the input port
Networking 10
L2 Networking - Single Tree Required
• Ethernet frame
– No hop-count
– Could loop forever in a L2 mis-configured network
– Same for broadcast packet
• Layer 2 network
– Required to have tree topology
– Single path between
every pair of stations
• Spanning Tree (ST) Protocol
– Running in bridges
– Helps building the spanning tree
– Blocks ports
Networking 11
Ethernet Switch
The computer attached to a port gets the illusion to have
» its own LAN segment
» its LAN segment bridged to all the other segments
Networking 12
Virtual LANs
♦ One bridge simulates multiple LANs / broadcast domains
♦ One LAN may be extended to other bridges
w xw
y
VLAN 100
VLAN 200
B1
x
z
VLAN 100
VLAN 200
B2
[da=w; sa=x; data]
[da=w; sa=x; vlanid=100; data]
[da=w; sa=x; data]
Networking 13
L3 Networking – Packet Formats
Version HLen TOS Length
Ident Flags Offset
TTL Protocol Checksum
SourceAddr
0 4 8 16 19 31
Version Traffic Class Flow Label
Payload Lengtht Next Header Hop Limit
SourceAddr (4 words)
0 4 8 16 24 31
SourceAddr
DestinationAddr
Options (variable)Pad
(variable)
Data
DestinationAddr (4 words)
Options (variable number)
Data
IPv4 IPv6
Networking 14
L3 Networking – Router
3ª generation router
Networking 15
L3 Networking – Multiple Trees …
♦ Every router
» finds the shortest path to the other routers and their attached networks
» Calculates its Shortest Path Tree (SPT)
♦ Routing protocol
» Run in routers» Run in routers
» Helps routers build their SPT
» RIP, OSPF, BGP
Destination Cost NextHop
A 1 A
C 1 C
D 2 C
E 2 A
F 2 A
G 3 A
B’s routing view
D
G
A
F
E
B
C
Networking 16
TCP
♦ Point to connection between a client and a server; port-to-port
♦ Reliable, flow control Sender
Data (SequenceNum)
Acknowledgment +AdvertisedWindow
Receiver
♦ Congestion control
AdvertisedWindow
Networking 17
Multimedia Traffic - Taxonomy
Applications
Elastic Real time (variation of the packet end-to-end delay)
Intolerant Tolerant
Nonadaptive Adaptive
Delay adaptiveRate adaptive
(packet loss)
(application reaction to packet loss)
(type of reaction)
Networking 18
RTP+RTCP/UDP
♦ Multimedia traffic
♦ Application-Level Framing
♦ Data Packets (RTP)
» sequence number
» timestamp (app defines “tick”)» timestamp (app defines “tick”)
» transported as UDP packets
♦ Control Packets (RTCP)
» sent periodically
» report loss rate (fraction of packets received since last report)
» report measured jitter
Networking 19
Traditional TCP/IP Communications Stack
IETF IP address
based
switching
T1
IP
TCP
APP
T1 | T2 T2 | T3
IP
T3 | T4
IP
T5
IP
TCP
APP
host bridge router router host
T4 | T5
bridge
IEEE MAC address
based
switching
Networking 20
Tunnel IP-in-IP
T1
IP
TCP
APP
T1 | T2 T2 | T3
IP
T3 | T4 T5
IP
TCP
APP
H1 bridge R1 R2 Server
T4 | T5
bridge
IP IP
IP
outer IP header inner IP header data
DA= 2nd IP address of R2SA= 2nd IP address of H1
TTLIP identification
IP-in-IP IP checksumflags fragment offset
lengthTOSver. IHL
DA= ServerSA=H1
TTLIP identification
lay. 4 prot. IP checksumflags fragment offset
lengthTOSver. IHL
TCP/UDP/ ... payload
Networking 21
Tunnel PPP over IP (E.g PPTP)
T1
IP
TCP
APP
T1 | T2 T2 | T3
IP
T3 | T4 T5
IP
TCP
APP
H1 bridge R1 R2 Server
T4 | T5
bridge
IP IP
IP
PPP
GREGRE
PPP
» GRE
– virtual point-to-point link
– routers at remote points
– over an IP network
» PPP adequate for
– Authentication
– Transporting IP packets
Networking 22
PPP over Ethernet
Networking 23
IPv6IPv6
Networking 24
A New IP Required
♦ IPv4– Small addressing space (32 bits)
– Non-continuous usage
– Some solutions used to overcome these problems
private networks (NAT), classless networks (CDIR)
♦ IETF developed new IP version: IPv6– Same principles of IPv4
– Many improvements
– Header re-defined
♦ IPv6 may be relevant for mobile communications
Networking 25
IPv6 – Improvements
» 128 bit addresses (16 octets, 8 shorts ). No classes
» Better QoS support (flow label)
» Native security functions (peer authentication, data encryption)
» Autoconfiguration (Plug-n-play)
» Routing
» Multicast
Networking 26
♦ 8 x 16 bit, hexadecimal. Separated by :
47CD : 1234 : 3200 : 0000 : 0000 : 4325 : B792 : 0428
♦ Compressed format: FF01:0:0:0:0:0:0:43 àààà FF01::43
Address Representation
♦ Compatibility with IPv4: 0:0:0:0:0:0:13.1.68.3 or ::13.1.68.3
♦ Loopback address: ::1
♦ Network prefix described by / , same as IPv4
» FEDC:BA98:7600::/40 àààà network prefix = 40 bits
Networking 27
Reserved Addresses
Allocation Prefix Fraction of(binary) Address Space
----------------------------------- -------- -------- -----Unassigned 0000 0000 1/256Unassigned 0000 0001 1/256Reserved for NSAP Allocation 0000 001 1/128Unassigned 0000 01 1/64Unassigned 0000 1 1/32Unassigned 0001 1/16Unassigned 0001 1/16Global Unicast 001 1/8 Unassigned 010 1/8Unassigned 011 1/8Unassigned 100 1/8Unassigned 101 1/8Unassigned 110 1/8Unassigned 1110 1/16Unassigned 1111 0 1/32Unassigned 1111 10 1/64Unassigned 1111 110 1/128Unassigned 1111 1110 0 1/512Link-Local Unicast Addresses 1111 1110 10 1/1024Site-Local Unicast Addresses 1111 1110 11 1/1024Multicast Addresses 1111 1111 1/256
Networking 28
Addresses –
Link-Local, Site-Local, Global Unicast, Anycast
» Link-Local
– Used for communication between hosts in the same LAN /link
– Address built from MAC address
– Routers do not foward packets having Link-Local destination addresses
» Site-Local
– Not used anymore– Not used anymore
» Global Unicast
– Global addresses
– Address: network prefix + computer identifier
– Structured prefixes
Network aggregation; less entries in the forwarding tables
» Anycast
– Group address; packet is received by any (only one) member of the group
» Multicast
– Group address; packet received by all the members of the group
Networking 29
Address Format
| n bits | m bits | 128-n- m bits | Global Unicast Address+------------------------+-----------+------------- ---------------+ (2000::/3)|001 global rout prefix | subnet ID | interf ace ID |+------------------------+-----------+------------- ---------------+
| 10 |
| bits | 54 bits | 64 bits | Link-Local Unicast address+----------+-------------------------+------------- ---------------+ (fe80::/10)|1111111010| 0 | interf ace ID | +----------+-------------------------+------------- ---------------+
| 10 |
| bits | 54 bits | 64 b its | Site-Local Unicast address+----------+-------------------------+------------- ---------------+ (fec0::/10) |1111111011| subnet ID | interf ace ID |+----------+-------------------------+------------- ---------------+
| n bits | 128-n bits | Anycast address+------------------------------------------------+- ---------------+| subnet prefix | 00000000000000 |+------------------------------------------------+- ---------------+
| 8 | 4 | 4 | 112 bits |+------ -+----+----+-------------------------------- -------------+|11111111|flgs|scop| group ID |+--------+----+----+------------------------------- --------------+
Multicast addressScope – link, site, global, ...
(ff::/8)
Networking 30
Headers IPv4 and IPv6
Version HLen TOS Length
Ident Flags Offset
TTL Protocol Checksum
SourceAddr
0 4 8 16 19 31
Version Traffic Class Flow Label
Payload Lengtht Next Header Hop Limit
SourceAddr (4 words)
0 4 8 16 24 31
SourceAddr
DestinationAddr
Options (variable)Pad
(variable)
Data
DestinationAddr (4 words)
Options (variable number)
Data
IPv4 IPv6
Networking 31
IPv6 Header
♦ Flow label à identifies packet flow
» QoS, resource reservation
» Packets receive same service
♦ Payload length
Version Traffic Class Flow Label
Payload Lengtht Next Header Hop Limit
SourceAddr (4 words)
0 4 8 16 24 31
♦ Payload length
» Header not included
♦ Hop limit = TTL (v4)
♦ Next header
» Identifies next header/extension
♦ Options à included as extension headers
DestinationAddr (4 words)
Options (variable number)
Data
Networking 32
Extension Headers
IPv6 HeaderNext Header = TCP
TCP header + data
Routing HeaderNext Header = TCP
TCP header + dataIPv6 HeaderNext Header = Routing
IPv6 HeaderNext Header = Routing
Routing HeaderNext Header = Fragment
Fragment HeaderNext Header = TCP
Fragment of
TCP header + data
IPv6 Hop-by-hop TCPDestination Routing Fragment Authenticate. ESP
Networking 33
Extension Headers
» Hop-by-hop
additional information, inspected by every node traversed by the packet
Other header are inspected only at the destination or at pre-defined nodes
» Destination: Information for the destination node» Destination: Information for the destination node
» Routing: List of nodes to be visited by the packet
» Fragmentation: Made by the source; it shall find MPU
» Authentication: Authentication (signature) of packet header
» ESP: Data encryption
Networking 34
Routing Header -
Pacote sent from S to D, through I1, I2, I3As the packet travels from S to I1:
Source Address = S Hdr Ext Len = 6Destination Address = I1 Segments Left = 3
Address[1] = I2Address[2] = I3Address[3] = D
As the packet travels from I1 to I2:
Source Address = S Hdr Ext Len = 6Destination Address = I2 Segments Left = 2Destination Address = I2 Segments Left = 2
Address[1] = I1Address[2] = I3Address[3] = D
As the packet travels from I2 to I3:
Source Address = S Hdr Ext Len = 6Destination Address = I3 Segments Left = 1
Address[1] = I1Address[2] = I2Address[3] = D
As the packet travels from I3 to D:
Source Address = S Hdr Ext Len = 6Destination Address = D Segments Left = 0
Address[1] = I1Address[2] = I2Address[3] = I3
List of visited
nodes
Networking 35
Example of Lab Network
quadroporta
banc_3 b anc_6 pc3---[HUB]---pc2----+ +----pc2---[HUB]- --pc32000:0:0:3::/64 | | 2000:0:0:6 ::/64
| |banc_2 | | b anc_5banc_2 | | b anc_5pc3---[HUB]---pc2--[HUB]-+ +-[HUB]--pc2---[HUB]- --pc32000:0:0:2::/64 | | | | 2000:0:0:5 ::/64
| | | |banc_1 | | | | b anc_4pc3---[HUB]---pc2----+ | | +----pc2---[HUB]- --pc32000:0:0:1::/64 | | 2000:0:0:4 ::/64
| |2000:0:0:e::/64| |2000:0:0:d::/64
| |[routerv6]
2000:0:0:1::12000:0:0:1::aa 2000:0:0:e::1
Networking 36
Configuration examples in Linux
tux13:~# /sbin/ifconfig eth0 inet6 add 2000:0:0:1:: 1/64tux13:~# ifconfig eth0eth0 Link encap:Ethernet HWaddr 00:C0:DF:08:D 5:99
inet addr:172.16.1.13 Bcast:172.16.1.255 Mask:255 .255.255.0inet6 addr: 2000:0:0:1::1/64 Scope:Globalinet6 addr: fe80::2c0:dfff:fe08:d599/10 Scope:LinkUP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1RX packets:81403 errors:0 dropped:0 overruns:0 fram e:0TX packets:2429 errors:0 dropped:0 overruns:0 carri er:0TX packets:2429 errors:0 dropped:0 overruns:0 carri er:0collisions:0 txqueuelen:100RX bytes:4981344 (4.7 MiB) TX bytes:260692 (254.5 KiB)Interrupt:5
tux13:~# /sbin/route -A inet6 add 2000::/3 gw 2000 :0:0:1::aatux13:~# route -A inet6Kernel IPv6 routing tableDestination NextHop Flags M etric Ref Use Iface::1/128 :: U 0 0 0 lo2000:0:0:1::1/128 :: U 0 0 0 lo2000:0:0:1::/64 :: UA 2 56 0 0 eth02000::/3 2000:0:0:1::aa UG 1 0 0 eth0 fe80::2c0:dfff:fe08:d599/128 :: U 0 0 0 lofe80::/10 :: UA 2 56 0 0 eth0ff00::/8 :: UA 2 56 0 0 eth0::/0 :: UDA 2 56 0 0 eth0
Networking 37
Identifier IEEE EUI-64
Method to create a IEEE EUI-64 identifier from an I EEE 48bit MAC identifier. This is to insert two octets, with hexadecimal valu es of 0xFF and 0xFE, in the middle of the 48 bit MAC (between the compan y_id and vendor supplied id). For example, the 48 bit IEEE MAC with global scope:
|0 1|1 3|3 4 ||0 5|6 1|2 7 |+----------------+----------------+---------------- + |cccccc0gcccccccc|ccccccccmmmmmmmm|mmmmmmmmmmmmmmmm||cccccc0gcccccccc|ccccccccmmmmmmmm|mmmmmmmmmmmmmmmm|+----------------+----------------+---------------- + 00:C0:DF:08:D5:99
where "c" are the bits of the assigned company_id, "0" is the value of the universal/local bit to indicate global scope, "g" i s individual/group bit, and "m" are the bits of the manufacturer-selected e xtension identifier. The interface identifier would be of the form:
|0 1|1 3|3 4 |4 6||0 5|6 1|2 7 |8 3|+----------------+----------------+---------------- +----------------+|cccccc1gcccccccc|cccccccc11111111|11111110mmmmmmmm |mmmmmmmmmmmmmmmm|+----------------+----------------+---------------- +----------------+
fe80::2c0:dfff:fe08:d599
Networking 38
Protocolo Neighbor Discovery (ND)
♦ IPv6 node uses ND for
» Find other nodes in the same link /LAN
» Find a node MAC address
ND substitutes ARP
» Find router(s) in its network
» Mantaining information about neighbour nodes
♦ ND similar to the IPv4 functions
» ARP IPv4
» ICMP Router Discovery
» ICMP Redirect
Networking 39
ND Messages
» ICMP messages (over IP); using Link Local addresses
» Neighbor Solicitation
Sent by a host to obtain MAC address of a neighbour / to verify its presence
» Neighbor Advertisement: Answer to the request» Neighbor Advertisement: Answer to the request
» Router Advertisement
Information about the network prefix; periodic or under request
Sent by router to IP address Link Local multicast
» Router Solicitation: host solicts from router a Router Advertisment message
» Redirect: Used by a router to inform na host about the best route to a destination
Networking 40
IPv6 Address Configuration
Networking 41
Packet Transmission