Computer Network Final Exam 2005

chinchillatidyΔίκτυα και Επικοινωνίες

26 Οκτ 2013 (πριν από 3 χρόνια και 5 μήνες)

67 εμφανίσεις

Computer Network Final Exam 2005
answer

1.

What are the differences between routing and forwarding? Please briefly explain
each of them.

(5%)

Ans


forwarding:

move packets from router’s input to appropriate router output
.

routing:

determine route taken by pac
kets from source to dest
ination
.

2.

During normal IP packet forward
ing

at

a router, which the following packet fields are
updated
? (2%)

Ans


(c)
TTL


(d)
checksum


3.
Routing Algorithm

Consider the network topology

shown below. The topology consists of mult
iple
routers interconnected by links. Each link has a

static cost associated with it which
represents the cost of sending data over that link.


a.

Please use Dijkstra

s shortest
-
path algorithm to compute the shortest path
from y to

all network nodes. Show your work by computing a table similar
to
tables below.

Ans


N


D(
x
)
,p(
x
)

D(
m
),
p(
m
)

D(
z
),
p(
z
)

D(
n
),
p(
n
)

D(
s
),
p(
s
)

D(
u
),
p(
u
)

y

3,y

1,y

10,y

I
nf

inf

I
nf

ym

2,m


6,m

3,m

I
nf

inf

ymx



6,m

3,m

inf

I
nf

ymxn



5,n


4,n

10,n

ymxns



5,n



7,s

ymxnsz



5,n




ymxnszu









x



y



m



z



s



n



u

3

5

10

2

3

1

2

2

7

1

1

b.

Consider the Distance Vector Algorith
m. When the link cost between
x

and
y

changes. For the following figure (a), please show why good news (cost
change from 3 to 1) travel fast, and for figure (b), please show why bad
news (cost change from 3 to 90) travel slowly. Please describe how the
rou
ting table of
x

changes with time. (10%)






Fig (a): Good news travel fast


Fig (b): Bad news travel slowly


4
. Compare and contrast the advertisements used by RIP and OSPF.
(5%)


Ans


OSPF

uses

Link state algorithm

.A

router periodically broadcasts routing
information to all other routers in the AS, not just to its neighboring routers. This
routing information sent by a router has one entry for each of the router’s neighbors;
the e
ntry gives the distance from the router to the neighbor.

A
RIP

advertisement sent
by a router contains information about all the networks in the AS, although this
information is only sent to its neighboring routers.

Use Distance Vector Algorithm.







5.

Wha
t is the difference between Link
-
Layer and Transport
-
Layer

reliable data
transfers? (Hint: With the TCP reliable data transfer, why does the underlying
link layer support data transmission reliability?) (5%)


Ans


Similar to transport

layer reliable delivery service, a link layer reliable
delivery service is achieved with acknowledgements and retransmissions.


A link
layer reliable delivery service is often used for links that are prone to high error rates,
such
as a wireless link, with the goal of correcting an error locally

on the link where
the error occurs

rather than forcing an end
-
to
-
end retransmission of the data by
transport or application
-
layer protocol.

(
課本
P.421)

x

z

1

3

80

y

90

x

z

1

3

80

y

1


6.
Suppose
that in pure ALOHA, there are

N

active

nodes
with
many frames to send
.
E
ach
node
transmits in
a
slot with probability
p
. F
ind the maximum efficiency of
pure ALOHA. Please derive the maximum efficiency STEP
-
BY
-
STEP. (10%)

Ans


Pure ALOHA



U
nslotted Aloha: simpler, no synchronization



W
he
n frame first arrives
,
transmit immediately



C
ollision probability increases:

F
rame sent at t0 collides with other frames sent in [t0
-
1,t0+1]


P(success by given node) = P(node transmits) .

P(no other node transmits in [p0
-
1,p0]

.

P(no other node transmits in [p0
-
1,p0] =p . (1
-
p)N
-
1 . (1
-
p)N
-
1=


choosing optimum p and then letting n
-
> infty= 1/(2e)

(6%)








(4%)

7.

Why Ethernet chooses CSMA/CD as its protocol instead of others. Please list its
advantages

(4%)

and compare it with slotted ALOHA, pure ALOHA and
CSMA.
(6%)

(10%)

Ans


CSMA/CD (C潬lisi潮 Detecti潮)




collisions

detected

within short time



colliding transmissions aborted, reducing channel wastage



collision detection:



easy in wired LANs: measure signal strengths, compare transmitted,
received signals



human analogy: the polite conversationalist

ALOHA




unslotted A
loha: simpler, no synchronization



when frame first arrives

transmit immediately



collision probability increases:

frame sent at t0 collides with other frames sent in [t0
-
1,t0+1]

***
maximum efficiency

and even worse


S
-
ALOHA

Pros




single active node can continuously transmit at full rate of channel
(1%)



highly decentralized: only slots in nodes need to be in sync



simple

Cons




collisions, wasting slots



idle slots



clock synchronization

***
efficiency

(1%)

CSMA

Carrier Sense Multiple Access

(2%)

If channel sensed idle: transmit entire frame

If channel sensed busy, defer transmission

Human analogy: don’t interrupt others!



colliding transmissions

aborted, reducing channel wastage
(1%)



The same with CSMA/CD but only detection but when collision happens, it can
not handle it.


8.
Hubs Switches and Routers

a.

Please briefly
describe

the sameness and differences between switches and
routers.
(5%)

Ans


Sam
eness

They are
both store
-
and
-
forward devices
.

Differences

But routers are
network layer devices (examine network layer headers)

and s
witches are link layer devices
.


R
outers maintain routing tables, implement routing algorithms


S
witches maintain switch
tables, implement filtering, learning algorithms



b.

What is a collision d
omain? (Please
associated
it
with switch
es

and hub
s
).

(5%)

Ans


A c
潬lisi潮
will h慰pen
if n潤e recei癥s tw漠潲 m潲e si杮慬s⁡ the⁳慭e⁴ime
.

Between⁴he⁨ub 慮d the⁨潳ts⁴h慴 co
nnect t漠ohe⁨ub
.
In a single segment, the
maximum node and its hub is 100 meters.

All of the LAN segments belong to the
same collision domain.

Whenever two or more nodes on the LAN segments
transmit at the same time, there will be a collision.

All of the
transmitting nodes
will enter exponential backoff.

Individual segment collision domains become one
large collision domain

and b
andwidth can not be aggregated

S
witch installation breaks subnet into LAN segments



switch filters packets:




same
-
LAN
-
segment fram
es not usually forwarded onto other LAN
segments

***
segments become separate collision domains


9.

Use module 2 arithmetic to compute the CRC code for message 101101110011
with the generator 10011.

Ans


CRC code

1011


10.

If a host was shut down and replaced its
network interface card, it will cause the
inconsistency of ARP caches in the other hosts in the same LAN. How can you
solve it

Please describe the details.

(5%)

Ans


ARP

Address Resolution Protocol



is “plug
-
and
-
play”:



N
odes create their ARP table
s without
intervention from net

administrator
.



Each IP node (Host, Router) on LAN has ARP table

ARP Table: IP/MAC address mappings for some LAN nodes
:

< IP address; MAC address; TTL>



TTL (Time To Live): time after which address mapping will be forgotten
(typically
20 min)


Each adapter on LAN has unique LAN address

and
A caches (saves)
IP
-
to
-
MAC address pair in its ARP table until information becomes old
(times out)



soft state: information that times out (goes away) unless refreshed


The host
重新連上
network
後,向所有人發出
broadcast

ARP packet

include
IP/MAC address
的對應,
other host in the same Len
可將
ARP tables
中的值改掉


other host

s
ARP table TTL timeout
後,重新對
host
發出
query
詢問
IP/MAC
address packet
,藉以得到新的值。


11.

What

s the main deference between MAC flat
address and IP hierarchical
address

(3%)

Ans


@
MAC flat address


portability


C
an move LAN card from one LAN to another

@
IP hierarchical address NOT portable


D
epends on IP subnet to which node is attached

12
.
Please list the characteristics of wireless

link?

(5%)

Ans

課本
P.508



D
ecreased signal strength: radio signal
attenuates as

it propagates
through matter (path loss)

距離一長能量減弱



I
nterference from other sources: standardized wireless network
frequencies (e.g., 2.4 GHz) shared by other devices (e.g., phone)
;
devices (motors) interfere as well

和其它裝置一起
share
頻寬



M
ultipath propagation: radio signal reflects off objects ground,
arriving at destination at slightly different times

會受地面其它物品影響導致抵達時間延遲



mobile
portable
移動方便

13.
Please compare CSMA/CA with CSMA/CD. Why IE
EE 802.11 uses CSMA/CA
instead of CSMA/CD? (10%)

Ans


IEEE 㠰㈮8ㄠ1AC Pr潴潣潬: CSMA/CA


A
void collisions: 2+ nodes transmitting at same time

802.11: CSMA
-

sense before transmitting
,
don’t collide with ongoing
transmission by other node

802.11:
no

collisi
on detection!



difficult to receive (sense collisions) when transmitting due to weak
received signals (fading)



can’t sense all collisions in any case: hidden terminal, fading



goal:
avoid collisions:

CSMA/C(ollision)A(voidance)

802.11 sender

1
.

if sense chan
nel idle for
DIFS

then

transmit entire frame (no CD)

2
.
if sense channel busy then

start random backoff time

timer counts down while channel idle

transmit when timer expires

if no ACK, increase random backoff interval, repeat 2

802.11 receiver

-

if fram
e received OK


return ACK after
SIFS
(ACK needed due to hidden terminal problem)


Avoiding collisions (more)

idea:

allow sender to “reserve” channel rather than random access of data frames:
avoid collisions of long data frames



sender first transmits

small

request
-
to
-
send (RTS) packets to BS using
CSMA



RTSs may still collide with each other (but they’re short)



BS broadcasts clear
-
to
-
send CTS in response to RTS



RTS heard by all nodes

*
sender transmits data frame

*
other stations defer transmissions

Avo
id data frame collisions completely

using small reservation packets!

Collision Avoidance: RTS
-
CTS exchange

CSMA/CD

CSMA/CA
相同處在於,它們均會做
sensing
,如果
sense idle
才會
送資料,否則就等待或停止。不同之處在於:
CSMA/CD
做了
collision detection
讓資料傳遞時即偵測,若有
collision
立即中止,
CSMA/CA
則不做
detection

是做
coll
ision avoidance
,在
sense

idle
後,會先進入
random backoff time
以避

collision
的發生,一旦可傳資料了就傳所有的
data
,傳完之後回覆一個
ack

以確定真的有收到。

802.11
使用
CSMA/CA
的原因在於
wireless
環境的限制,在無線網路中無法一
邊傳訊息一邊接收訊息且
collision is hard to detect
,因為有
signal fading and
hidden terminal problem
,因此不適用
CSMA/CD



14.

Please
compare mobility support via Direct Routing with that via Indirect
Routing. (5%)

Ans


Let end
-
systems handle it:

indirect routing:

communication from correspondent to mobile goes
through home agent, then forwarded to remote

direct routing:

correspondent g
ets foreign address of mobile, sends
directly to mobile

Indirect routing


Mobile uses two addresses:



permanent address: used by correspondent (hence mobile location is
transparent

to correspondent)



care
-
of
-
address: used by home agent to forward datagrams
to mobile

F
oreign agent functions may be done by mobile itself

T
riangle routing: correspondent
-
home
-
network
-
mobile



inefficient when correspondent, mobile are in same network

S
uppose mobile user moves to another network



registers with new foreign agent



new
foreign agent registers with home agent



home agent update care
-
of
-
address for mobile



packets continue to be forwarded to mobile (but with new
care
-
of
-
address)

mobility, changing foreign networks transparent:
on going connections can be
maintained!


Direct
routing


O
vercome triangle routing problem



non
-
transparent to correspondent: correspondent must get care
-
of
-
address
from home agent



If

mobile changes visited network

Accommodating mobility with direct routing



anchor foreign agent: FA in first visited netw
ork



data always routed first to anchor FA



when mobile moves: new FA arranges to have data forwarded from old FA
(chaining)