final exam ftp server assignment10 application layer10 transport10 network10 link-layer10 security10...
TRANSCRIPT
Final Exam
FTP Server Assignment 10
Application Layer 10
Transport 10
Network 10
Link-Layer 10
Security 10
TotalTotal 6060
Coverage and distribution of marks
Types of QuestionsTypes of Questions
• Define terms, identify technologies, explain purpose
• Explain concepts and protocols– Using diagrams (label them properly)– Appropriate variables (or parameters)
• Solve problems (e.g. apply DV Algorithm, CRC)
MAC Protocols: a taxonomyMAC Protocols: a taxonomy
Three broad classes:Three broad classes:• Channel Partitioning Protocols
– divide channel into smaller pieces (time slots, frequency bands, multiple access codes)
– allocate piece to node for exclusive use
• Random Access Protocols
– allow collisions– recover from collisions
• Taking turns Protocols– tightly coordinate shared access to avoid collisions
Animation
Channel Partitioning (CDMA)Channel Partitioning (CDMA)
CDMA (Code Division Multiple Access) • Sender: sends encoded data bits simultaneously• Receiver: assigned a unique code (i.e. code set partitioning)• Has been used by military; now used mostly in wireless
broadcast channels (cellular, satellite,etc)• all users share same frequency, but each user has own
''chipping'' sequence (i.e., code) to encode data• encoded signal = (original data) X (chipping sequence)• decoding: inner-product of encoded signal and chipping
sequence• Advantage: allows multiple users to coexist and transmit
simultaneously with minimal interference (if codes are orthogonal)
CDMA: two-sender interferenceCDMA: two-sender interference
Assumption: interfering bit signals are additive
Random Access protocolsRandom Access protocols
• When node has packet to send– transmit at full rate (R) of channel– no a priori coordination among nodes
• two or more transmitting nodes -> collision!!,• random access MAC protocol specifies:
– how to detect collisions– how to recover from collisions (e.g., via delayed
retransmissions)
• Examples of random access MAC protocols:– slotted ALOHA– ALOHA– CSMA and CSMA/CD
CSMA: CSMA: (Carrier Sense Multiple Access)(Carrier Sense Multiple Access)
CSMA: listen before transmit:• If channel sensed idle: transmit entire pkt• If channel sensed busy, defer transmission
– Persistent CSMA: retry immediately with probability pp when channel becomes idle (may cause instability)
– Non-persistent CSMA: retry after random time interval
• human analogy: don't interrupt others!
RULES: •Listen before speaking (carrier sensing)• If someone else begins talking at the same time, stop talking (collision detection)
Animation
CSMA collisions
collisions can occur:
propagation delay means two nodes may not yethear each other's transmissioncollision:
entire packet transmission time wasted
spatial layout of nodes along ethernet
note:
role of distance and propagation delay in determining collision prob.
Channel propagation delay
4 nodes attached to a linear broadcast bus; Horizontal axis shows position of
each node in space
D senses the channel is idle at t1
CSMA/CD (Collision Detection)CSMA/CD (Collision Detection)
CSMA/CD: carrier sensing, deferral as in CSMA– collisions detected within short time– colliding transmissions aborted, reducing channel
wastage – persistent or non-persistent retransmission
• collision detection: – easy in wired LANs: measure signal strengths,
compare transmitted, received signals– difficult in wireless LANs: receiver shut off while
transmitting
• human analogy: the polite conversation
Recall earlier routing discussion
223.1.1.1
223.1.1.2
223.1.1.3
223.1.1.4 223.1.2.9
223.1.2.2
223.1.2.1
223.1.3.2223.1.3.1
223.1.3.27
A
BE
Starting at A, given IP datagram addressed to B:
look up net. address of B, find B on same net. as A
link layer send datagram to B inside link-layer frame
B’s MACaddr
A’s MACaddr
A’s IPaddr
B’s IPaddr
IP payload
datagramframe
frame source,dest address
datagram source,dest address
Additional addresses!
ARP: Address Resolution Protocol
• Each IP node (Host, Router) on LAN has ARP module, 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)
Question: how to determineMAC address of Bgiven B's IP address?
ARP for Ethernet (RFC 826), Intro to ARP,TCP/IP Tutorial (RFC 1180)
Resides in RAM
ARP: Address Resolution ProtocolHow is ARP Table initialized?
• It’s plug-and-play!• Not configured by Network Administrator• Tables are automatically updated when one node is disconnected from subnet
ARP protocol: A Scenario• A knows B's IP address, wants to learn physical address of B • A broadcasts ARP query pkt, containing B's IP address
– all machines on LAN receive ARP query
• B receives ARP packet, replies to A with its (B's) physical layer address
• A caches (saves) IP-to-physical address pairs until information becomes old (times out) – soft state: information that times out (goes away) unless refreshed
Passes ARP packet within the frame up to its parent node
Only one node (node with IP address=DEST IP in the ARP packet) sends back to the
querying node a response ARP packet with the desired mapping
In turn, the querying node can then update its ARP Table and send its IP datagram
Routing to another LAN
A
RB
Network 1: Network address: 111.111.111/24
Network 2: Network address: 222.222.222/24
Two Types of Nodes: • Hosts• Routers
Router• has an IP address for each of its interfaces• has an ARP module for each of its interfaces• has an adapter for each of its interfaces
• each adapter has its own MAC Address2 interfaces, 2 IP addresses, 2 ARP modules, 2 adapters (2
MAC addresses)
Routing to another LANrouting from A to B via R
In routing table at source Host, find router 111.111.111.110• In ARP table at source, find MAC address E6-E9-00-17-BB-
4B, etc
A
RB
Network 1: Network address: 111.111.111/24
Network 2: Network address: 222.222.222/24
• A creates IP packet with source A, destination B
A
RB
How a HOST on Subnet 1 sends a datagram to a HOST on Subnet 2?
Passes datagram to adapter Host A must indicate to its adapter an appropriate MAC
address (DEST)
Note: Before sending the frame, MAC address must be acquired (should match one of the nodes in subnet; otherwise, will be lost). Then, frame is sent to Subnet.
• A uses ARP to get R's physical layer address for 111.111.111.110 (adapter side)
A
RB
Note: Router interface• handles routing; uses Forwarding Table
Adapter • uses ARP to find MAC address
• (adapter) A creates Ethernet frame with R's physical address as dest, Ethernet frame contains A-to-B IP datagram
• (adapter) A's data link layer sends Ethernet frame • (adapter) R's data link layer receives Ethernet frame
– Passes frame to Network Layer• (network layer) R removes IP datagram from Ethernet frame,
sees its destined to B– Using router R’s Forwarding table) – table tells R to forward
datagram via router interface 222.222.222.220• R’s interface passes datagram to its adaptor
A
RB
• (adapter) R uses ARP to get B's physical layer address • (adapter) R creates frame containing A-to-B IP datagram
sends to B
A
RB
Ethernet: uses CSMA/CD
A: sense channel, if idle then {
transmit and monitor the channel; If another transmission is detected
then {
abort and send jam signal;
update # collisions;
delay as required by exponential backoff algorithm;
goto A
}
else {done with the frame; set collisions to zero}
}
else {wait until ongoing transmission is over and goto A}
Run without explicit coordination with other adapters on the Ethernet
Connectionless unreliable service to
Network Layer
No signal energy in channel for 96 bit
times
Ethernet’s CSMA/CD (more)Jam Signal: make sure all other transmitters are aware
of collision; 48 bits;
Exponential Backoff: • Goal: adapt retransmission attempts to estimated
current load– heavy load: random wait will be longer
• first collision: choose K randomly from {0, 2m-1};
delay is K x 512 bit transmission times• after second collision: choose K from {0,1,2,3}…• after ten or more collisions, choose K from {0,1,2,3,4,
…,1023}
=min(10, num of collisions)
For 10Mbps Ethernet, time to transmit 1 bit = 0.1 microseconds
Hubs• Physical Layer devices: essentially repeaters
operating at bit levels: repeat received bits on one interface to all other interfaces
• Hubs can be arranged in a hierarchy (or multi-tier design), with backbone hub at its top
Definition of Terms
Bridges Spanning Tree• for increased reliability, it is desirable to have
redundant, alternate paths from source to dest• with multiple simultaneous paths, cycles result -
bridges may multiply and forward frame forever• solution: organize bridges in a spanning tree by
disabling subset of interfaces
Disabled
Bridge Learning: example
Suppose C sends a frame to D and D replies back with a frame to C
C sends the frame to the bridge, but the bridge has no info. about D, so it floods
both LANs bridge notes that C is on port 1 frame ignored on upper LAN frame received by D
Bridge Learning: example
D generates a reply to C, sends bridge sees frame from D bridge notes that D is on interface 2 bridge knows C on interface 1, so it selectively forwards the frame out via
interface 1
Routers vs. Bridges
Routers + and -+ arbitrary topologies can be supported, cycling is limited
by TTL counters (and good routing protocols)
+ provide firewall protection against broadcast storms
- require IP address configuration (not plug and play)
- require higher processing bandwidth
• bridges do well in small (few hundred hosts) while routers used in large networks (thousands of hosts)
Ethernet Switches (more)
Dedicated
Shared
Institutional Network using a combination of hubs, Ethernet switches, router
Interconnection DevicesCOMPARISON OF FEATURES
HUBS BRIDGES ROUTERSETHERNET SWITCHES
Traffic Isolation
No Yes Yes Yes
Plug-and-Play
Yes Yes No Yes
Optimal Routing
No NoYes No
Cut-through
Yes No No Yes
Node Update
0 1 2 3 Min
0 999 999 999 999 0
1 999 1 999 999 1
2 999 999 3 999 3
3 999 999 999 7 7
Min
0 3
1 70
2 0
3 2
Rcv event, t=1.484 at 0; Source: 2, Dest: 0
Node 0
srtpkt2
0 1 2 3 Min
0 999 999 999 999 0
1 999 1 73 999 1
2 999 999 3 999 3
3 999 999 5 7 5
3 + 70 = 73
Node Update
Min
0 0
1 1
2 3
3 5
Apply Poisoned ReverseNode 0
srtpkt0
0 1 2 3 Min
0 999 999 999 999 0
1 999 1 999 999 1
2 999 999 3 999 3
3 999 999 5 7 5
73 turns 999
Send new mincost to neighbors via tolayer2()
DV AlgorithmThere are four routers connected via certain links (figure). Suppose that the following table
is used for the initialisation of C’s routing table:
Cvia
A B D
dest
A 1 ∞ ∞
B ∞ 3 ∞
D ∞ ∞ 2
And the minimum cost is an array of 4 integers in the order A, B, C, D:A advertises its minimum costs as: 0, 4, 1, ∞B advertises its minimum costs as: 4, 0, 3, 1D advertises its minimum costs as: ∞, 1, 2, 0
Show the first update on C’s table if C simultaneously receives packets with the minimum cost information from the routers A, B and D