Professional Documents
Culture Documents
4.1 - Gii thiu v chc nng ca tng mng. 4.2 - Network service model (VC and Datagram). 4.3 - Giao thc IP (Internet Protocol) 4.4 - Thit b tng mng - B nh tuyn (router) 4.5 - Gii thut chn ng (Routing Algorithms) 4.6 - Chn ng trong mng Internet.
network data link physical network data link physical application transport network data link physical
1
3 2
4.1 - Gii thiu v chc nng ca tng mng. 4.2 - Network service model (VC and Datagram). 4.3 - Giao thc IP (Internet Protocol). 4.4 - Thit b tng mng - B nh tuyn (router). 4.5 - Gii thut chn ng (Routing Algorithms). 4.6 - Chn ng trong mng Internet.
Virtual Circuit
Thit lp lin kt trc khi truyn d liu v hu b lin kt sau khi truyn xong.
VC setup: trc khi truyn, tng mng phi thit lp mt knh truyn o (VC) t sender ti receiver ( bit a ch). Data transfer: d liu c truyn qua VC. VC teardown: mt khi sender hoc receiver mun ngt VC, n thng bo cho network layer bit, network layer s hu b VC. Cn c gi l connection-oriented
Mi gi tin cha thm thng tin v knh m n s i qua (VC identifier number). Cc routers/packet switches trn knh o (VC) lun nm gi trng thi ca knh i qua n.
Chng 4. Giao thc tng mng 7
Datagram network
application transport network data link physical
host A
server B
Khng thit lp knh truyn. Cc thit b chuyn mch khng cn nm gi trng thi cc knh. Gi tin c truyn da trn a ch ca receiving host. ng i ca cc gi tin gia hai host c th khc nhau.
application transport network data link 1. Send data physical application transport 2. Receive data network data link physical
10
ATM
Mng in thoi (chuyn mch knh). Tng tc ngi-ngi i hi: Thi gian truyn.
tin cy.
Dch v phi c m bo. Cc thit b cui n gin, dng nh c nh:
in thoi.
Mc phc tp nm bn trong mng.
FDM
TDM
12
4.1 - Gii thiu v chc nng ca tng mng. 4.2 - Network service model (VC and Datagram) 4.3 - Giao thc IP (Internet Protocol) 4.4 - Thit b tng mng - B nh tuyn (router) 4.5 - Gii thut chn ng (Routing Algorithms) 4.6 - Chn ng trong mng Internet.
13
14
IP datagram format
IP protocol version number header length (bytes) type of data max number remaining hops (decremented at each router) upper layer protocol to deliver payload to 6 = TCP; 17 = UDP 32 bits ver head. type of len service length fragment 16-bit identifier flgs offset time to upper Internet layer live checksum 32 bit source IP address 32 bit destination IP address Options (if any) E.g. timestamp, record route taken, specify list of routers to visit. total datagram length (bytes) for fragmentation/ reassembly
32-bit = 4 s 8-bit
223.1.1.3 223.1.3.1
223.1.3.27
15
16
IP addressing: Class-full
223.1.3.27
Network:
Mng to bi cc interface c phn network trong IP addr ging nhau. Cc host cng network c th trao i d liu khng cn thng qua router.
223.1.3.1
LAN
223.1.3.2
network = 3 IP networks
17
18
Subnet
i khi cn chia nh mt mng thnh cc mng nh hn (subnet)
V d:
19
20
Subnet mask
Mt interface trong mng cn c:
IP address Mt n mng con (subnet mask):
L mt s 32 bit bao gm cc bit cao = 1 v cc bit thp = 0. Cc bit 1 quy nh subnet, cc bit 0 quy nh a ch host. t subnet mask c th xc nh ranh gii gia a ch mng v a ch ca interface (host).
IP addressing: CIDR
Class-full addressing: s phn lp cng nhc, khng cn thch hp na. CIDR (Classless InterDomain Routing):
V tr ngn cch gia net addr v host addr tu . addr format: a.b.c.d/x, vi x l s lng bit dnh cho net addr.
network part
host part
200.23.16.0/23
Organization 1
200.23.18.0/23 200.23.20.0/23
Organization 2
Organization 7
200.23.30.0/23
ISPs-R-Us Send me anything with addresses beginning 199.31.0.0/16
24
. . .
. . .
Fly-By-Night-ISP
23
10.0.0.1 10.0.0.2
All datagrams leaving local network have same single source NAT IP address: 138.76.29.7, different source port numbers
Datagrams with source or destination in this network have 10.0.0/24 address for source, destination (as usual)
25
NAT: Implementation
NAT router: outgoing datagrams: replace (source IP address, port #) of every outgoing datagram to (NAT IP address, new port #) . . . remote clients/servers will respond using (NAT IP address, new port #) as destination addr. remember (in NAT translation table) every (source IP address, port #) to (NAT IP address, new port #) translation pair incoming datagrams: replace (NAT IP address, new port #) in dest fields of every incoming datagram with corresponding (source IP address, port #) stored in NAT table
NAT example
2: NAT router changes datagram source addr from 10.0.0.1, 3345 to 138.76.29.7, 5001, updates table 2 NAT translation table WAN side addr LAN side addr 138.76.29.7, 5001 10.0.0.1, 3345 1: host 10.0.0.1 sends datagram to 128.119.40, 80
1
10.0.0.4
S: 128.119.40.186, 80 D: 10.0.0.1, 3345
10.0.0.1 10.0.0.2
138.76.29.7
10.0.0.3 4: NAT router changes datagram dest addr from 138.76.29.7, 5001 to 10.0.0.1, 3345
Chng 4. Giao thc tng mng 28
IPv6
IPv4: s dng 32-bit a ch IP s l khng ??? IPv6:
s dng 128-bit a ch. phn tiu (header) cung cp kh nng x l nhanh hn, cht lng hn (QoS). 40 bytes header. khng cho php phn mnh (fragmentation). ICMP v6.
ICMP msg
c ng gi trong IP datagrams/packet. type + code + 8 bytes of IP datagram.
29
30
IPv6
Chuyn i tt c cc hosts, routers sang s dng IPv6: khng th!!! Chuyn i dn dn:
tn ti cc nt mng IPv4 v IPv6. IPv6 c kh nng x l gi tin IPv4. Tunneling: gi tin IPv6 c coi nh phn data (payload) ca IPv4 khi i qua cc nt mng IPv4.
ng dng khng i hi cht lng khng c coi l flow. next header: giao thc tng trn.
Chng 4. Giao thc tng mng 31
32
Tunneling
Logical view: A
IPv6
E
IPv6
F
IPv6
Physical view:
A
IPv6
Flow: X Src: A Dest: F data
B
IPv6
C
IPv4
D
IPv4
E
IPv6
F
IPv6
Src:B Dest: E
Flow: X Src: A Dest: F data
Src:B Dest: E
Flow: X Src: A Dest: F data
4.1 - Gii thiu v chc nng ca tng mng. 4.2 - Network service model (VC and Datagram). 4.3 - Giao thc IP (Internet Protocol). 4.4 - Thit b tng mng - B nh tuyn (router) 4.5 - Gii thut chn ng (Routing Algorithms). 4.6 - Chn ng trong mng Internet.
A-to-B: IPv6
E-to-F: IPv6
33
34
B nh tuyn router
Thc thi cc gii thut chn ng (routing algorithms). Chuyn tip (forwarding) cc gi tin t cng vo ti cng ra thch hp.
Input ports
Decentralized switching:
s dng forwarding table c trong input port memory tra cu output port queuing: nu cc gam d liu (datagram) n nhanh qu, cn phi xp hng ch x l.
Chng 4. Giao thc tng mng 36
35
Output ports
4.1 - Gii thiu v chc nng ca tng mng. 4.2 - Network service model (VC and Datagram). 4.3 - Giao thc IP (Internet Protocol). 4.4 - Thit b tng mng - B nh tuyn (router). 4.5 - Gii thut chn ng (Routing Algorithms). 4.6 - Chn ng trong mng Internet.
Network layer
routing table
39
40
10
reassembly
Reassembly: Cc gam d liu nh c hp nht thnh gam d liu ln (ngc li) ti im n cui cng
Chng 4. Giao thc tng mng 41
42
v
2
3 3
w
1
z
2
1
3 2
1 Network = Graph = G(N,E). N = tp hp cc routers = { u, v, w, x, y, z }. E = tp cc ng ni gia cc routers. = { (u,v), (u,x), (v,x), (v,w), (x,w), (x,y), (w,y), (w,z), (y,z) } Trng s = chi ph (cost): tr, nghn mng, cc ph ng i tt = ng i c chi ph thp nht.
43 Chng 4. Giao thc tng mng 44
11
K hiu:
c(i,j): chi ph phi tr i t i ti j (trc tip) D(v): gi tr hin ti ca chi ph phi tr i t nh xut pht
ti nh v.
Dijsktras Algorithm
1 Initialization: 2 N = {A} 3 for all nodes v 4 if v k vi A 5 then D(v) = c(A,v) 6 else D(v) = 7 8 Loop 9 Tm w khng thuc N sao cho D(w) nh nht 10 N = N + w 11 for all v k vi w v khng thuc N: 12 D(v) = min( D(v), D(w) + c(w,v) ) 13 until tt c nt thuc N
5 2 1
B
2
3 3 1
C
1
F
2
48
47
12
B
8
C
2
D () A
D
destination
A 1 7 6 4
B 14 8 9 11
D 5 5 4 2
D (C,D) = c(E,D) + minw {D (C,w)} D (A,D) = c(E,D) + minw {D (A,w)} D (A,B) = c(E,B) + minw{D (A,w)}
= 8+6 = 14
loop!
B C D
= 2+2 = 4
= 2+3 = 5 loop!
49
50
Distance table
D () A
destination
routing table
D 5
destination
DV Algorithm: Initialization
At all nodes, X:
1 Initialization: 2 for all adjacent nodes v: 3 DX(*,v) = infinity /* the * operator means "for all rows" */ X 4 D (v,v) = c(X,v) 5 for all destinations, y X 6 send min D (y,w) to each neighbor /* w over all X's neighbors */
w
A 1 7 6 4
B 14 8 9 11
A B C D
B C D
5 4 2
Distance table
Routing table
51 Chng 4. Giao thc tng mng 52
13
DV Algorithm: Loop
8 loop 9 wait (until I see a link cost change to neighbor V 10 or until I receive update from neighbor V) 11 12 if (c(X,V) changes by d) 13 /* change cost to all dest's via neighbor v by d */ 14 /* note: d could be positive or negative */ 15 for all destinations y: D X(y,V) = DX(y,V) + d 16 17 else if (update received from V wrt destination Y) 18 /* shortest path from V to some Y has changed */ 19 /* V has sent a new value for its min w DV(Y,w) */ 20 /* call this received new value is "newval" */ 21 for the single destination y: D X(Y,V) = c(X,V) + newval 22 23 if we have a new minw DX(Y,w)for any destination Y 24 send new value of min D X(Y,w) to all neighbors w 26 forever
Chng 4. Giao thc tng mng 53
DV Algorithm: example
Y
7
Z
D (Z,Y) = c(X,Y) + minw {D (Z,w)} = 2+1 = 3
X Y
54
DV Algorithm: example
Distance Vector
Ch nm gi thng tin lin quan ti cc nt hng xm msgs ch c gi cho cc nt hng xm. tc hi t c th khc nhau tu tng tnh hung, i khi ri vo trng thi lp v hn. Thng tin dn ng ca nt ny c s dng bi nt khc.
Mt nt gp s c c th gy nh hng ti cc nt khc.
Y
7
55
56
14
Hierarchical Routing
Dn ng theo tng mc mng, do: Quy m mng Internet l rt ln:
mt nt khng th cha tt c cc bn ghi cho mi ch! vic cp nht bng dn ng tn km!
Nhu cu mng t tr
Internet = network of networks ngi qun tr mng mun iu khin vic dn ng (routing) trong mng h qun l.
Gateway router:
router c bit trong AS s dng intra-AS routing protocol vi cc routers khc trong AS
57
C.b b A.a a
B.a a c B Host h2 b
a Host h1
59
60
15
Internet = nhiu Autonomous Systems (AS) : 4.1 - Gii thiu v chc nng ca tng mng. 4.2 - Network service model (VC and Datagram). 4.3 - Thit b tng mng - B nh tuyn (router). 4.4 - Giao thc IP (Internet Protocol). 4.5 - Gii thut chn ng (Routing Algorithms). 4.6 - Chn ng trong mng Internet.
Stub AS: cc cng ty nh: mt kt ni vi AS khc. Multihomed AS: cng ty ln: nhiu lin kt ti AS khc. Transit AS: nh cung cp (mc ni cc AS vi nhau).
Two-level routing:
Intra-AS: ngi qun tr c quyn chn gii thut cho ring mng ca mnh Inter-AS: gii thut duy nht (inter-AS routing: BGP)
61 Chng 4. Giao thc tng mng 62
Internet AS Hierarchy
Intra-AS border (exterior gateway) routers
16
24
S0
From an Ethernet/FastEthernet interface to a hub/switch: straight through cable From an Ethernet/FastEthernet interface to a PC/other Router: crossover cable.
172.16.1.1/24
2 2 17 17 Hoboken S0 S1 172.16.3.1/24
2/ .2. .1 6
24
1/ .4. .1 6
24
2/ .4. .1 6 72 1
waycross
24
S1
172.16.5.1/24
Hobeken(config)# ip route 172.16.1.0 255.255.255.0 172.16.2.1 Command des. Net subnetmask interface Hobeken(config)# ip route
Chng 4. Giao thc tng mng 65
Intra-AS Routing Tn gi khc: Interior Gateway Protocols (IGP) Mt s giao thc: RIP: Routing Information Protocol OSPF: Open Shortest Path First IGRP: Interior Gateway Routing Protocol (Cisco proprietary)
.2. .1 6
1 /2
4 2 .1 17
.2 / 6.2
24 2 .1 17 S0
.1 / 6.4
24 2 17
.4. .1 6
2 /2
S0
172.16.1.1/24
S1 172.16.3.1/24
Hoboken
S1
waycross
172.16.5.1/24
waycross(config)# ip route
waycross(config)# ip route
[next-hop-address | outgoing interface] Default routes are used to route packets with destinations that do not match any of the other routes in the routing table
0.0.0.0
0.0.0.0
0.0.0.0
0.0.0.0
172.16.4.1
67
68
17
RIP: Example
z w A x D C
Destination Network
x y
Chng 4. Giao thc tng mng
w y z x
Next Router
A B B --
....
2 2 7 1
Routing table in D
69 Chng 4. Giao thc tng mng 70
RIP routing tables managed by application-level process called route-d (daemon) advertisements c gi nh k, qua UDP packets.
Three attached class C networks (LANs) Router only knows routes to attached LANs Default router used to go up Route multicast address: 224.0.0.0 Loopback interface (for debugging)
Chng 4. Giao thc tng mng 71 Chng 4. Giao thc tng mng 72
18
OSPF (Open Shortest Path First) open: publicly available; RFC 2178 Uses Link State algorithm
LS packet dissemination Topology map at each node Route computation using Dijkstras algorithm
OSPF advertisement carries one entry per neighbor router Advertisements disseminated to entire AS (via flooding)
Carried in OSPF messages directly over IP (rather than TCP or UDP
Hierarchical OSPF
Two-level hierarchy: local area, backbone. Link-state advertisements only in area each nodes has detailed area topology; only know direction (shortest path) to nets in other areas. Area border routers: summarize distances to nets in own area, advertise to other Area Border routers. Backbone routers: run OSPF routing limited to backbone. Boundary routers: connect to other ASs.
R3
BGP AS2
AS3
(OSPF intra-AS routing)
BGP R1 R2
75
76
19