Sei sulla pagina 1di 2

Chapter 1: Computer Networks and the Internet. RFC: request for comment, (informal) standard. Define prots.

ard. Define prots. TCP: Transmission Control Prot. Used by Telnet, SMTP, FTP, HTTP. UDP: User Datagram
Prot. Used for streaming, telephony, RIP routing updates, DNS. Circuit Switching: Resources reserved for session. Connection state maintained by switches and routers. Telephone networks. FDM: Frequency-Division
Multiplexing. Link dedicates frequency band (typically 4kHz wide) to each connection. Trend: being replaced by TDM: Time Division Multiplexing. One timeslot in every frame dedicated to connection. Both TDM and
FDM idle during silence. Packet Switching: Uses resources on demand, may have to wait. Internet. Statistical Multiplexing. If message segmented: pipeline. Virtual Circuit network: Forwards packets according to vc
numbers. Switch has vc-number translation table. Switches maintain state information. VC networks more complex than Datagram network: forward packets according to dest address in header of packet. Switch
maintains no state information. Can be either connectionless or connection-oriented. Network access: Link from end system to Edge Router: first router on path to distant end system. DSL: digital subscriber line, uses
FDM (high speed down 50kHz-1MHz, med speed up 4kHz-50kHz, two-way tel. 0-4kHz). Actual bandw function of: dist to ISP modem, gauge of twisted pair line, degree of elec. interference. Explicitly designed for
short dist to ISP modem. HFC: hybrid fiber coaxial cable. Cable modem divides HFC network into downstream (more bandw: higher speed than up) and upstream channel. HFC shares rates among homes, DSL doesn’t.
Broadcast medium: every packet sent by head end travels to every home. Packets sent by homes at same time collide: less effective bandwidth up. Physical Medium: between transmitter-receiver pair. Guided: solid
medium: fiber-optic, twisted pair, coax. Unguided: waves propagate atmos and space: wireless LAN, digital satellite channel. Unshielded Twisted pair: copper, most common for LAN, cat 3 (voice grade, 10Mbps
Ethernet), cat 5 (more twists, Teflon insulation, 100Mpbs). Coaxial cable: baseband: 50-ohm, 10Mbps, T-connector. Broadband: 75-ohm,1+Mbps Internet. Both can be used as guided shared medium: all end systems
receive packets from other end systems. Fiber optic: no elec interf., low attenuation up to 100km, hard to tap. Preferred long distance medium. High cost. ISP: tier-1: connected to all other tier-1. Internet backbone
networks. Some are also tier-2. Provider to Tier-2: customer of 1, regional or national coverage, connects to only a few tier-1. Lower tier: connect via one or more tier-2. Access ISP: at bottom of hierarchy. Peer: two
directly connected ISP’s. POP: point of presence: point where ISP connects to others. NAP: network access point. Also connect ISP’s. Operated by 3rd pty or backbone prov. Processing delay: time req. to examine
header, determine where to direct, check for bit-errors. Queuing delay: funct of intensity and nature of traffic. Transmission delay (store and forward delay): L/R. Time req. to push packet’s bits onto link. Propagation
delay: time req. to prop. to next router. Depends on physical medium. Formula: dnodal=dproc+dqueue+dtrans+dprop. Traffic intensity: La/R, should be less than 1, a=packets/sec.
dend-end=N(dproc+dtrans+dprop). n-PDU: layer-n prot data unit. Internet: 5 Layers: 5-PDU-1-PDU. Protocol stack: prots of different layers taken together. Service model: layer n-1 offers services to n. Layers: 5:application
(5-PDU=message): prots: HTTP, SMTP, FTP. Supports netw apps. 4:transport (segment), prots TCP, UDP. Divides msg into parts. Transports app-layer msgs betw client&server sides of app. 3:network (datagram). IP.
Routes datagrams from host to host. 2:link (frame). Routes frame from router to router betw src and dest. Ethernet, PPP. Prots link-dependent. 1: physical (1-PDU). Moves indivual bits from node to node. Prots link-
dependent. Chapter 2: Application Layer Process: program running in end system. Communicates w/ other process by exchanging msgs. Identifies other process by IP and socket #.
Application layer protocol: HTTP, SMTP, FTP. Defines: types of exchanged msgs (eg req and rsp msgs), syntax of msgs (fields, delineation), semantics (meaning of info), rules for determining when and how process
sends msgs and responds to msgs. Some app-layer prots are proprietary. Network app divided in 2 sides: client side (HTTP: browser) and server side (HTTP: server). Socket (=API, application programmers’
interface): interface between application layer and transport layer in host. User agent: interface between user and network app (browser, mail reader). Bandwidth-sensitive app (need certain bandw: multimedia)<-
>elastic app (make use of as much or as little bandw as is available: mail, file/ web transfers). TCP: Connection oriented: after three-way handshaking (req conn, ack conn, ack+file req) a full-duplex tcp connection
exists. Connection is very loose, only processes are aware. Reliable transport: all data sent w/out error and in order. Congestion control, flow-control. UDP: no handshaking, no guarantee on delivery or order. No
congestion control or flow-control. HTTP: HyperText Transfer Prot. Port 80. Defines how clients request webpages and how servers transfer pages to clients. Uses TCP as underlying transport prot. Stateless protocol:
http server maintains no info on clients. Nonpersistent connections: conn closed after each object. HTTP/1.0. For each req object new tcp conn: buffers allocated, tcp variables kept in client and server: Burden on
webserver. Persistent connections: multiple objects transferred in lifetime of 1 conn. HTTP/1.1 default. W/out pipelining: new req only when prev response rcvd. 1 RTT to req and rcv each object. W/ pipelining: Req as
soon as reference to object encountered: back-to-back. 1 RTT expended for all referenced objects. HTTP request msg: 1 req line (method (GET, POST, HEAD for HTTP 1.0, HTTP 1.1 includes for example PUT
(upload) and DELETE), URL (identifies object on host) and HTTP version fields) followed by header lines: Host, Connection (close or not), User-agent (ie Mozilla/4.0), Accept-language (preferred language),
Authorization (if required by server, username and password), Cookie. After header lines: CRLF, entity body (empty w/ GET, used w/ POST). HTTP response msg: Initial status line (3 fields: prot version, status code,
corresponding status msg), header lines (Connection, Date, Server, Last-Modified, Content-Length, Content-Type (object type officially indicated by Content-Type header, not by file extension), Set-cookie, Location),
entity body (data). Common status codes: 200 OK: request succeeded, info returned in resp. 301 Moved permanently: obj permanently moved, new URL in Location: header of resp msg. 400 Bad request: request not
understood by server. 401 Authorization Required. 404 Not found: document doesn’t exist on server. 505 HTTP Version Not Supported. Cookies: Can be used to authenticate user. 4 Components: 1 Cookie header line
in HTTP response msg, 2 Cookie header line in HTTP request msg, 3 cookie file kept on user’s end system managed by browser, 4 back-end db at Web site. Conditional GET: If-modified-since header line, exactly
equal to last-modified line in response msg header. If not modified server responds w/ status line 304 Not modified, w/out requested obj in body. FTP: File Transfer Prot. Port 21 for control conn. Runs on top of TCP.
Uses 2 parallel TCP connections: control conn (used for sending control info between hosts: used id, pwd, commands to change remote dir and to put and get files) and data conn (used to actually send 1 file, then
closed). FTP sends control info out-of band, HTTP sends control info in-band. FTP must maintain state about user (keep track of current dir, associate control conn w/ user account). This constrains number of sessions
FTP can maintain simultaneously. Common FTP commands: USER username:, PASS password:, LIST: send list of files in current remote dir, RETR filename: get file from dir, STOR filename: put file into dir. FTP
Replies: 3 digit numbers: 331 Username OK, password required, 125 Data connection already open; transfer starting, 425 Can’t open data connection, 452 Error writing file. E-mail (user agents, mail servers, SMTP,
POP). SMTP (simple mail transfer prot): Runs on TCP, port 25. Much older than HTTP. Restricts body of mail to seven-bit ASCII: binary multimedia data must be encoded and decoded to ASCII. HTTP is mainly pull
protocol, SMTP is push protocol. HTTP puts each object in response msg, SMTP places all of msg’s objects in 1 msg. MIME: Multipurpose Internet Mail Extensions: extra headers in mail for content other than ASCII
text. Content-Transfer-Encoding: used first to decode msg according to type of encoding used. Content-Type: indicates type, allows receiving user agent to take appropriate action. Types: text (text/plain, text/html),
image(/jpeg, /gif), application(/msword), multipart (typically multipart/mixed, ; Boundary=StartOfNextPart, each object in msg preceded by type and transfer-encoding header lines). Received: header line added by
receiver. Specifies name of sending and receiving SMTP-server and time. POP3: Three phases: authorization (user <username>, pass <pwd>), transaction (retrieves msgs), update (after quit command, server deletes
marked mails). Commands: list, retr, dele, quit. Only 2 responses in POP3: +OK, -ERR. IMAP: Internet Mail Access Prot. More complex than POP3, more features. Associates msgs w/ folder, provides commands to
create or delete folders or move msgs btw folders. Maintains user state info across sessions. Permits user to obtain components of msg (eg just header). Web-Based E-Mail: uses HTTP to connect w/ remote mailbox.
Many implementations use IMAP for folder funct. DNS: Domain Name System. Runs over UDP. Port 53. Distributed db implemented in hierarchy of name servers (often UNIX running BIND (Berkeley Internet Name
Domain) software). Process: Browser extracts hostname from URL and passes hostname to client side of DNS app. DNS client sends query containing hostname to DMS server. Receives reply w/ IP address for
hostname. Browser opens TCP conn to HTTP server process at IP. Other services: Host Aliasing (Alias is more mnemonic than canonical), Mail Server Aliasing (mail app invokes DNS to obtain canonical hostname),
Load Distribution (sites replicated on multiple servers, different end system, different IP. Set of IP’s associated w/ 1 canonical hostname. DNS responds w/ all IP’s, rotates order). DNS decentralized because: No single
point of failure, less traffic volume per server, no distant centralized db, maintenance). Three types: local (default, owned by isp, close to client), root (queried by local, dozen across globe), authoritative (in host’s isp,
always has record for host, queried through authoritative). Recursive queries: a asks b, b asks c, c tells b, b tells a<->Iterative queries: a asks b, b tells a to ask c, a asks c. Query to root is iterative, rest recursive. DNS
Caching: record cached querying name server (typically 2 days). Resource Record (Name, Value, Type, TTL): Type=A then Name=hostname, Value=IP. Type=NS: Name=domain, value=hostname of authoritative
name server. Type=CNAME: Name=hostname Value=canonical hostname for alias in Name. Type=MX: Value=canonical name of mail server w/ alias hostname Name. If name server authoritative it has type A record.
Else has type NS for domain and type A for IP of name server in type NS record. DNS Msgs: Query and Reply; have same format: 12Byte header (16Bit id #, 1Bit query/reply flag, 1Bit authoritative flag, 1Bit recursion-
desired flag, 1Bit recursion-available flag, 4 number fields indicating # of 4 types of data: Question section (name, type), Answer section (Resource Records (more than 1 for replicated Web servers)), Authority section
(records of other auth. servers), Additional section (helpful info, eg if answer gives MX, additional gives A w/ IP). Chapter 3: Transport Layer Transport-layer prot: provides logical
comm. betw processes, vs network-layer prot: provides logical comm. betw hosts. Transport layer prots live in end systems; intermediate routers don’t recognize transport layer info. Prots UDP (unreliable), TCP
(reliable). Both provide transport-layer multiplexing and demultiplexing: extending host-host delivery to process-process del. Each segment has fields for source port number and dest. port #. Well known port numbers
0-1023 are restricted, rest up to 65535 aren’t. Connectionless (de-)multiplexing (UDP, socket identified by 2-tuple(dest IP, dest port))<-> Connection-Oriented (de-) multiplexing (TCP, socket identified by 4-tuple
(src IP, src port, dest IP, dest port)). UDP.Takes msgs from application process, attaches src and dest port numbers and passes segment to network layer. UDP vs TCP: no connection establishment (faster), no connection
state (no track of parameters: support many more active sessions), small packet header overhead (8 vs 20 bytes), finer application-level control over what data is sent, and when (tcp has congestion control and continues
to send until receipt acked, not good for real-time). UDP header: 4 2-bit fields: src port, dest port, length, checksum (1’s complement of sum of all 16-bit data words in segment, but UDP doesn’t recover from error).
Reliable data transfer: (IP (Internet Prot) delivery service is best-effort: no guarantees on delivery, order, integrity of data: unreliable.)
ARQ (Automatic Repeat reQuest prots): based on retransmission of erroneous data, provides error detection, receiver feedback (ACK, NAK), retransmission. Stop-and-wait prots: sender will not send new data unless
sure receiver had correctly received current packet. Alternating-bit protocol (rdt3.0): packet seq # alternate between 0 and 1. Rdt3.0:
Finite State S1: rdt_send(data) / sndpkt=make_pkt(0,data,checksum), udt_send(sndpkt), start_timer. S2: rdt_rcv(rcvpkt)&&(corrupt(rcvpkt)||isACK(rcvpkt,1) / Λ.
Machine (FSM) S2 S3: timeout / udt_send(sndpkt), start_timer. S4: rdt_rcv(rcvpkt)&&notcorrupt(rcvpkt)&&isACK(rcvpkt,0) / stop_timer S5: rdt_rcv(rcvpkt) / Λ.
S6-10 idem but w/ 1’s and 0’s exchanged. R1: rdt_rcv(rcvpkt)&&notcorrupt(rcvpkt)&&has_seq0(rcvpkt) / extract(rcvpkt,
R1 data), deliver_data(data), sndpkt=make_pkt(ACK,0,checksum), udt_send(sndpkt). R2: rdt_rcv(rcvpkt)&&
wait 4 S1 wait 4 wait 4 rdt3.0 wait 4 (corrupt(rcvpkt||has_seq0(rcvpkt)) / udt_send(sndpkt). R3-4 idem, 1’s and 0’s exch.Stop-and-wait (not pipelined)
call 0 ACK0 0 fr below receiver 1 fr below R2 ttrans=L/R, utilization Usender=(L/R) / (RTT+L/R). Pipelining: range of seq #’s increased, more pckts buffered. 2
S3 different approaches to pipelined error recovery: Go-Back-N (GBN) and selective repeat (SR). GBN: sliding-
rdt3.0 sender window protocol. [0, base-1] are packets sent and acked. [base,nextseqnum-1] r sent but not acked.[nextseqnum,
base+N-1] can be used for packets that can be sent immed. [base+N, >] cannot be used until base has been acked. Range of per-
S4 missible seqnumbers for transmitted but not acked pckts is window of size N. Range of seq#’s is [0,2k-1] where k=number of bits in seq# field. Fig: Incmng: Λ / base=1,next-
seqnum=1. 1: rdt_send(data) / if (nextseqnum<base+N) {sndpkt[nextseqnum]=make_pkt(nextseqnum,data,checksum); udt_send(sendpkt[nextseqnum]);
if (base==nextseqnum) start_timer; nextseqnum++} else {refuse_data(data)}. 2: timeout / start_timer; udt_send(sndpkt[base]);udt_send(sendpkt[base+1]);
wait 4 wait 4 wait … ; udt_send(sendpkt[nextseqnum-1]). 3: rdt_rcv(rcvpkt)&&notcorrupt(rcvpkt) / base=getacknum(rcvpkt)+1; If (base==nextseqnum) stop_timer
ACK1 call 1 GBN else start_timer. 4: rdt_rcv(rcvpkt)&&corrupt(rcvpkt) / Λ. ACK for n is cumulative ack for all pckts up to and including n. Receiver FSM: see sndr
sndr fsm, but 2 loops. Incoming: Λ / expectedseqnum=1; sndpkt=make_pkt(0,ACK,checksum). 1: rdt_rcv(rcvpkt)&&notcorrupt(rcvpkt)&&hasseqnum
(rcvpkt,expectedseqnum) / extract(rcvpkt,data); deliver_data(data); sndpkt=make_pkt(expectedseqnum,ACK,checksum); udt_send(sndpkt);expectedseqnum++
2: default / udt_send(sndpkt). Selective repeat (SR): Sender retransmits only packets it suspects were lost or corrupted. Receiver must individually ack all correctly received
packets. ACK all packets, even if not in order. Out-of-order are buffered. Each pckt has own logical timer. If ACK seqnum=send_base then window slides forward to next unacked pckt. Window size must be less than
or equal to half the size of seq number space. Both GBN and SR assume packets aren’t reordered in the network.
TCP: Connection-oriented, full-duplex, point-to-point. 3-way handshake. Setting aside of send-buffer happens in handshake. MSS (maximum segment size) depends on TCP implementation (determined by OS): is
maximum bytes of data in segment, not including headers. Often 512, 536,1500 bytes. TCP header fields: src and dest port numbers, checksum, 32 bit sequence number, 32 bit ack number, 16 bit receive window field
(used for flow control), 4 bit header length field (# of 32 bit words in header, can be variable because of:), variable length options field (negotiate MSS, window scaling factor for use in high-speed networks , also
timestamping option), 6 bit flag field (ACK (used to indicate ack-value is valid), RST+SYN+FIN (used for conn. setup and teardown), PSH (pass to upper layer immediately, not used), URG (data marked by sending-
side upper-layer entity as urgent, not used)). Sequence number for segment is byte-stream number of first byte in segment, not number of segment itself. Acknowledgment number is seqnum of next byte expected. TCP
provides cumulative acknowledgments (only acks bytes up to 1st missing byte). TCP RFC’s don’t impose rules about what to do w/ out-of-order pckts. EstimatedRTT=(1-α)*EstimatedRTT + α*SampleRTT (called
exponential weighted moving avrg (EWMA)). α recommended to be 1/8 (2-3). Variability of RTT: DevRTT=(1-β)*DevRTT + β*| SampleRTT-EstimatedRTT |, β recommended value of ¼ (2-2). TimeoutInterval=
EstimatedRTT + 4*DevRTT. If sender receives 3 duplicate acks, it assumes packet acked 3 times is lost and performs fast retransmit (before timer expires). TCP error-recovery best categorized as hybrid of GBN and
SR. Flow Control: LastByteRcvd – LastByteRead ≤ RcvBuffer because buffer overflow not permitted. RcvWindow = RcvBuffer – ( LastByteRcvd - LastByteRead) is dynamic spare room. RcvWindow goes into
receive window field in header of every segment to sender. Initially RcvWindow = RcvBuffer. Sender makes sure that LastByteSent – LastByteAcked ≤ RcvWindow, so no overflow of receive buffer can occur.
Connection setup: Step 1: Segment called SYN segment. client-side TCP sends TCP segment to server-side TCP, no app-layer data, SYN bit in header = 1. Client chooses initial sequence number (client_isn). Step 2:
Server extracts SYN segment from datagram, allocates buffers and variables to conn, sends conn. granted segment (called SYNACK segment) to client TCP. Conn. granted segment: no app-layer data, SYN bit =1, ack
field =client_isn+1, seqnum server_isn. Step 3: client also allocates buffers and variables. Sends segment: acks SYNACK by putting server_isn+1 in ack field. SYN bit = 0 since conn established. <=3-way handsh.
Connection end: Client app process issues close command: client-side TCP sends segment w/ Fin-bit flag=1. Server acks, then sends own shutdown segment w/ FIN=1. Client acks and all resources are deallocated.
Network congestion: costs: 1: Large queuing delays as packet-arrival rate nears link capacity. 2: Sender must perform retransmissions to compensate for dropped pckts due to buffer overflow. 3: Unneeded
retransmissions in face of large delays may cause router to use bandwidth for unneeded copies of pckt. 4: When a packet is dropped, all transmission capacity used at upstream routers for that pckt wasted. Two
approaches to congestion control: End-to-end congestion control: network layer provides no explicit support to transport layer for congestion-control. Congestion must be inferred by end systems. TCP must take this
approach, since IP provides no feedback regarding congestion. TCP segment loss indicated by timeout or triple duplicate ack. Network assisted congestion control: (eg ATM ABR) routers provide explicit feedback to
sender. Two forms: 1 Choke pckt sent by router says it’s congested. 2 Router updates field in pckt to indicate congestion. Receiver then notifies sender. ATM ABR: Interspersed w/ data are RM (resource management)
cells (default 1 per 32). At destination RM cell turned back to sender, possibly modified. Switch can also generate RM cell itself. Sender computes rate at which to send. 3 Mechanisms for signaling congestion-related
info: 1. Each data cell contains EFCI bit (explicit forward congestion indication). Set to 1 by congested switch to signal congestion. Destination sets CI (congestion indication) bit of RM cell to 1. 2. Switch can set NI (no
increase) bit in RM to 1 under mild congestion, CI to 1 under severe congestion. 3. ER (explicit rate) setting, 2 byte field in RM cell: switch may lower value. ER is thus set to minimum supportable rate of all switches in
path. TCP (Reno) Congestion Control: Each side of connection keeps track of congestion window (CongWin), which imposes constraint on sending rate. Amount of unacked data may not exceed minimum of
CongWin and RcvWindow: LastByteSent – LastByteAcked ≤ min{CongWin, RcvWindow}. TCP congestion control algorithm: 3 major components: 1: AIMD: additive increase (CongWin increased roughly 1 MSS
per RTT), multiplicative decrease (CongWin halved after 3 duplicate acks (but not below 1 MSS), dropped to 1 MSS after timeout). Linear increase is called congestion avoidance. Results in sawtooth pattern. 2: Slow
start. At start CongWin set to 1 MSS (resulting sending rate roughly MSS/RTT). Rate doubled every RTT (1 extra MSS per received ack) until loss event: CongWin halved, then linear increase (AIMD). 3: Reaction to
timeout events: If triple duplicate ack: Fast Recovery: CongWin halved. If timeout event: Sender back to slowstart, CongWin set to 1 MSS. Exponential growth until value of CongWin equals half of value before
timeout. Then linear growth. Threshold: Variable which determines window size at which slow start (exponential increase) will end and congestion avoidance (linear increase) will start. Initially set to large value
(65Kbytes). At loss event: threshold set to half current CongWin. TCP Tahoe (early version of TCP) cuts CongWin to 1 MSS after either triple duplicate ack or timeout, vs TCP Reno only after timeout (three duplicate
acks mean three additional segments beyond lost segment have been received). Average throughput of connection w/ Reno is 0.75*W/RTT (W=window size w when loss occurs). TCP is fair because of additive
increase and multiplicative decrease (in graph of a vs b line goes to origin after loss). UDP is not fair. W/ TCP possible to take unfair rate by opening parallel connections. Latency is time from when client initiates TCP
conn until time when entire object received. W = fixed size CongWin (integer denoting # outstanding segments). O = size of object. MSS = S bits. R = transmission rate of link (bps). Static windows latency: 2 cases: 1:
WS/R > RTT + S/R: ack received before first window transmitted. Latency = 2RTT+O/R = Minimum Latency. 2: WS/R < RTT + S/R: first window worth of segments transmitted before first ack. Server must stall and
wait until 1st ack received. K = number of windows of data that cover the object: K=O/(WS). Latency = 2RTT + O/R + (K-1)(S/R + RTT – WS/R). (K-1)(S/R + RTT – WS/R) is amount of time server stalls. Dynamic
windows latency: K = min{k:20+21+22+…+2k-1 ≥ O/S} = min{k:2k-1 ≥ O/S} = min{k:k ≥ log2((O/S)+1)} = ┌ log2((O/S)+1)┐. Stall time is difference betw S/R + RTT (time server begins transmission of 1st segment in
window until receipt of 1st ack for segment in window) and (S/R)*2k-1 (transmission time of kth window): Stall time = [S/R + RTT – 2k-1(S/R)]+. Latency = 2RTT + O/R + ΣK-1k=1[S/R + RTT – 2k-1S/R]+. Q = number of
times server stalls if object has infinite # segments. Q = └ log2(1+RTT/(S/R)) ┘+ 1. Actual # stalls: P = min{Q, K-1}. Combining this: Latency = 2RTT + O/R + P[RTT+S/R] – (2p-1)*S/R. In summary, slow start can
significantly increase latency if object size relatively small and RTT relatively large. Chapter 4: Network Layer and Routing (3 major components: network-layer prot: Internet: IP, path determination
component, network-layer error- and information-reporting prot.) 3 Important functions: 1: Path determination. The algorithms that calculate these paths are called routing algorithms: link state routing and distance
vector routing. 2: Forwarding: Switching pckt from input to output link. 3: Call setup: Some network-layer architectures (ATM) require routers along path to handshake w/ eachother to set up state. Internet doesn’t.
Network service model defines characteristics of end-to-end transport of data betw sending and receiving end systems. Virtual Circuits (VCs): Also called network layer connection oriented service. Used by ATM,
Frame Relay, X.25. Behave much like telephone netw. 3 Phases: 1: VC setup: Sender contacts network layer, specifies receiver, waits for network to set up VC. Network layer determines path (updating tables in
switches, may reserve resources (bandw)). 2: Data transfer. 3: VC teardown: Sender tells network to terminate VC. Network layer informs other end system and updates tables in path’s pckt switches. Signaling msgs:
Msgs sent into netw by end systems to indicate initiation or termination of VC and msgs passed betw switches. Signaling protocols: prots used to exchange signaling msgs. Datagram network layer: Also called
network layer connectionless service. Also known as best-effort service. Internet. End system stamps pckt w/ dest address and sends pckt into network. No VC setup. Packet switches (routers in the Internet) don’t
maintain state info about VC’s because there aren’t any. Pckt switches forward pckt by examining dest address, indexing a forwarding table w/ dest address and forwarding in dir of dest. ATM: provides for multiple
service models. 2 most important: Constant bit rate (CBR) ATM network service: First ATM service model. End-to-end delay, variability in end-to-end delay and fraction of cells lost or late all guaranteed to be less than
specified values. Available bit rate (ABR) ATM network service: Cells can be lost, but not reordered (as in Internet). Minimum cell transmission rate (MCR) guaranteed to conn. See also chapter 3. 2 others: Variable bit
rate (VBR) and Unspecified bit rate (UBR). Datagram vs VC: VC notion principal roots in telephony; complexity w/in network, dumb end systems. Internet’s datagram has more sophisticated end systems, network
layer service as simple as possible. Internet model makes no service guarantees: easier to interconnect networks using different link-layer tech (eg satellite, Ethernet, fiber, radio). Internet model can have new services
added by attaching host w/ new application-layer prot: new services adopted quickly. Routing protocol: Determines path for a packet. Host is attached directly to default router: also called first-hop router. Source
router: default router of source host. Destination router: default router of dest host. Routing algorithm (heart of routing prot): finds “good” path from source to dest, w/ least cost. Global routing algorithm: has
complete global knowledge about network connections and all link costs. Algorithms w/ global state info called link state algorithms. Decentralized routing algorithm: Calculation of least cost path is iterative,
distributed. Each node begins w/ only info on own directly attached links. Distance vector algorithm is a decentralized routing algorithm. Static vs dynamic routing algorithms: static routes change very slowly, often by
human intervention; dynamic: routing paths change as traffic loads or topology change. Dynamic can be run periodically or in response to changes. Load-sensitive vs –insensitive routing algorithms: sensitive: link costs
vary dynamically reflecting congestion in underlying link; Internet’s algorithms (RIP, OSPF, BGP) are insensitive. Link state routing algorithms: Each node broadcasts identities and costs of links to all other routers
(link state broadcast). All nodes then have complete and identical view of network. Each node can then run link state alg. Dijkstra’s algorithm: 1: initialization: currently known least-cost paths to directly attached
step N D(v),p(v) etc neighbours set. 2: first iteration: find node not added to set N (set of nodes w/ least-cost path from src definitely known) w/ least cost as of end of previous iteration. Add to N, then
update D(v) (cost of path from src to dest v that has currently least cost) for all nodes v and set p(v) (previous neighbouring node of v on lowest cost path). 3: Second iteration: find
node not added to N w/ least cost, add to N, calculate cost D(v) to remaining nodes and set p(v). 4: etc. See table. Computational cost: 1st iteration: check n nodes, 2nd check n-1 nodes, 3rd check n-2 nodes, overall total
nodes checked: n(n+1)/2. Worst case complexity of order n squared: O(n2). Distance vector (DV) algorithm. Iterative, asynchronous, distributed. Algorithm is self-terminating. Distance table:
Cost via data structure maintained at each node (see table). Entry is dist table Dx(Y,Z) is sum of cost of direct one-hop betw X and Z (c(X,Z)) plus Z’s currently known minimum-cost path from itself to
E
D () A B Y, that is Dx(Y,Z) = c(X,Z)+minw{Dz(Y,w)}. When node computes new minimum cost it must inform neighbours. Forwarding table (indicates which outgoing link for given dest) easily
dest

A O construced from dist table. Bellman-Ford algorithm: used in many routing prots in practice, including Internet’s RIP, BGP, ISO, IDRP, Novell IPX, ARPAnet. Good news travels fast, bad
B O news slow (count to infinity problem). Solution: adding poisoned reverse: if Z routes through Y to get to X, it will tell Y that it’s direct cost to X is ∞. Solves problem for 2 neighbouring nodes,
not for 3 or more nodes. Link state vs Distance Vector routing: LS: requires O(nE) msgs (n=# nodes, E=# links). Whenever link cost changes, new cost sent to all nodes. DV requires msgs
betw directly conn nodes at each iteration. Can converge slowly and can have routing loops while converging, also suffers from count-to-infinity problem. Under LS route calculations somewhat separated because node
only calculates for itself providing degree of robustness, under DV incorrect node calculation can be diffused through entire network. LS and DV are essentially only routing algorithms used in practice today. Hot
potato routing: router tries to get rid of pckt asap by forwarding on any not-congested outgoing link, regardless of dest. Another broad class of routing algorithms formulates problem mathematically as constrained
optimization problem known as network flow problem. Circuit-switched routing algorithms are derived from telephony: of interest to packet-switching networks when per-link resources (bandwidth, buffers) are to be
reserved for each connection. Problems: Organizing routers into regions or Autonomous systems (ASs) solves problem of scale and administrative autonomy (organization wants to run and administer network as it
wishes and still connect to outside networks). Routers w/in same AS run same alg (eg LS or DV) called intra-autonomous system routing protocol (RIP, OSPF). Gateway routers have task of routing from AS to AS
and use inter-autonomous system routing protocol (BGP).
IP Internet Protocol: Network layer of internet often called IP layer. Interface: boundary between host or router and physical link. IP address is associated w/ interface, not host or router. IP-address is 32 bits long,
written in dotted-decimal. Divided in network part and host part. Network itself has address xxx.xxx.xxx.xxx /xx (eg 223.1.1.0/24), where /xx is known as network mask: indicates leftmost xx bits of 32 define network
address and are referred to as network prefix. Broadcast address: 255.255.255.255. Four classes of address: Class A: 8 bits network, 24 bits interface (27 networks as 1st bit fixed as 0), class B (beginning w/ 10) 214
networks w/ 216 interfaces, class C (beginning w/ 110) 24 bits and 8 bits, class D (beginning w/ 1110) reserved for multicast addresses. Fifth class (beginning w/ 11110) reserved for future. Classless Interdomain
Routing (CIDR): network part any number of bits. CIDRized network address has dotted-decimal form a.b.c.d/x. Subnetting can be used to create internal networks. IP addresses are managed under authority of
Internet Corporation for Assigned Names and Numbers (ICANN). ICANN also manages DNS root servers. Obtaining IP address: Router interface manually configured by sysadmin. Host manually or by DHCP
(Dynamic host configuration prot), which allocates IP-addresses and informs of first-hop router and DNS server address. DHCP is plug-and-play. Routing: Host adds final
Dest Next Nhops (Interface) dest address to datagram, consults own table, indicates to link layer to which address (router or dest) datagram should be sent. Router consults table, sends to correct interface.
netw router (only rtr) Etc. IP datagram format: Version number: 4 bits. Header length: 4 bits, needed because variable # of options. Typical IP datagram has header of 20 bytes because no
options. Type of service (TOS): Allow for different types (eg real-time, non-real-time) of datagram to be distinguished. Datagram length: Total length of IP datagram including header. 16 bit field so IP datagram could
be 65535 bytes long. Identifier, flags, fragmentation offset: Have to do w/ IP fragmentation. Time-to-live (TTL): included so datagrams don’t circulate forever, decremented by 1 each time it’s processed by router. If 0,
datagram must be dropped. Protocol: used only at dest. Indicates to which transport-layer prot datagram must be passed (6 for TCP, 17 for UDP) (analogous to port number field in transport-layer segment). Header
checksum: aids router in detecting bit errs. Calculated by treating each 2 bytes as number, adding numbers and calculating 1’s compl. (known as Internet Checksum). If error: discard. Checksum must be recalculated at
each router as ttl and possibly options change. Source and destination IP addresses. Options: dropped in IPv6 because rarely used yet complicates matters. Data (payload): In most cases TCP or UDP segment, however
may be ICMP message. Router architecture: 4 components: 1 input ports: performs physical layer funct of terminating incoming physical link, data layer funct needed to interoperate w/ data link layer funct, lookup and
forwarding funct so that packet emerges at appropriate output port. Multiple ports often gathered together on single line card. 2 Switching fabric: connects input ports to output ports. 3 Output ports: reverse data link
and physical layer funct as input. When link bidirectional output port typically paired w/ input on same line card. 4 Routing processor: executes routing prots, maintains routing info and forwarding tables, performs
network mngmnt functions. Input ports: Shadow copy of routing table. Desirable for input port processing to proceed at line speed. Packet may be blocked from entering switching fabric, so must be queued. Switching
fabric: At heart of router. Switching via memory: packet copied from input port into mem, processed and copied to output port buffers. Modern routers lookup in input line card. Switching via bus: Bus shared:only one
packet at a time can be transferred. Blocked packets are queued at input port. Switching bandwidth limited to bus speed. Switching via interconnection network: Crossbar switch is interconn network connecting N input
ports w/ N output ports via 2N buses. Output ports: Send-side link- and physical layer funct that interact w/ input port on other end of link. Takes datagrams stored in output port’s mem and transmits them over
outgoing link. Queuing: If n input and output ports and switching fabric at least n times as fast as line speeds: no queuing at input. Output may receive n packets but can only send 1: queue. Pckt scheduler must choose
one pckt among queued (FCFS or weighted fair queuing (WFQ)). Plays crucial role in providing quality of service guarantees. If switching fabric not fast enough for incoming: queue at input. Drop-tail: arriving pckt
dropped. Head-of-line (HOL) blocking: queued packet must wait because blocked by other packet at head of line (switch fabric chose other pckt 1st instead of blocking pckt).
Chapter 5: Link Layer and Local Area Networks Link-layer prot (Ethernet, 802.11, wireless LAN, token ring, PPP, Frame Relay) defines format of frames exchanged betw nodes at ends of link, and actions
taken by these nodes. Implemented in NIC. Services provided by link layer prot: Framing: encapsulate datagram, header often includes physical address. Link access: Media Access Control (MAC) prot specifies rules
by which frame is transmitted onto link. Reliable delivery: often used for links w/ high error rates (eg wireless), many wired link-layer prots don’t offer reliable delivery service. Flow control: Similar to transport layer’s,
to prevent buffer overflow. Error detection: Many link-layer prots offer error detection mech, often implemented in hardware and more sophisticated than in transp layer. Error correction: Rcvr can also correct detected
error. Some (ATM) provide error corr only for header. Half-duplex, full-duplex (transmit & receive simultaneously or not). Error detection: Parity checks, checksumming (typically employed in transp layer), cyclic
redundancy checks (typically in link layer in adapters). Forward error correction (FEC): ability of receiver to detect and correct errors (using two-dimensional parity). Can be used by themselves or in conjunction w/
ARQ techniques (chpt 3). Checksumming: Data bits treated as sequence of k-bit integers. Internet checksum: Used at transport layer because easy to implement in software. 1’s complement of sum of k-bit integers. If
sum of data and checksum not all 1’s: error. Checksumming weak compared to CRC: Used at link layer. Also known as polynomial codes. Sender and receiver must agree on generator G (r+1 bit pattern). Most
significant bit of G=1. Sender chooses R (r additional bits (CRC)) and appends them to data D (d bits) such that d+r bit pattern exactly divisible by G using modulo 2 arithmetic w/o carries and borrows (also in mult and
div), so addition and subtraction are identical and both are XOR of operands. Receiver divides d+r by G. If remainder nonzero: error. Multiplication by 2k left shifts bit pattern by k places. Thus, given D and R, D*2r
XOR R yields d+r bit pattern. Want to find R such that there is n such that: D*2r XOR R = nG. If we XOR (that is add modulo-2 w/o carry) R to both sides: D*2r = nG XOR R. So if we divide D*2r by G remainder is
precisely R: R=remainder (D*2r)/G calculated by long division (D with r zeros divided by G) until remainder has r bits. Standards have been defined for 8-,12-,16- and 32-bit generators G. Each of CRC standards can
detect burst errors of fewer than r+1 bits and can detect any odd # of bit errors. Burst of length greater than r+1 detected w/ probability 1-(0.5)r. Multiple access protocols: prots by which nodes regulate transmission
into shared broadcast channel (Ethernet, Shared wireless, Satellite). Desirable characteristics: 1: when only 1 node has data, it has throughput R, 2: M nodes have data then each has R/M on avrg, 3: prot is decentralized
so no master node can fail and bring down entire system, 4: prot is simple so inexpensive to implement. 3 categories: channel partitioning prots, random access prots, taking turn prots. Channel partitioning prots:
TDM and FDM. TDM divides time into time frames and each frame into N time slots (N nodes). FDM divides R bps channel into different frequencies (each w/ bandw R/N). Code division multiple access (CDMA):
Assigns different code to each node. Allows nodes to transmit simultaneously. Each bit sent is encoded by multiplying by code that changes at much faster rate (chipping rate) than original seq of bits. If sender’s codes
chosen carefully each receiver can recover data sent by given sender. di=(1/M)*Σm=1MZi,m**cm (*=sender s, cm=mth bit in assigned CDMA code, di=data bit, M=# minislots, Zi.m=output of CDMA encoder). Random
access prots: Transmitting node always transmits at full rate of channel. If collision wait random time and try again until no collision. ALOHA, CSMA, Ethernet. Slotted ALOHA: All frames exactly L bits. Time
divided into slots of L/R secs (slot equals time to transmit 1 frame). All nodes synched. Node starts to transmit only at beginning of slot. If collision: retransmit w/ probability p. Probability given node has a success is:
p(1-p)N-1. Probability arbitrary node has success is efficiency is: E(p)=Np(1-p)N-1. Max efficiency = 1/e. ALOHA: 1st ALOHA unslotted (unsynched): fully decentralized. Price: half as eff as slotted ALOHA (max 1/2e).
CSMA (Carrier sense multiple access): Carrier sensing: listen before transmitting. CSMA/CD Collision det’n: node listens while transm, stops transm if detects another node transm. Channel propagation delay: plays
crucial role in performance. If large then larger chance that carrier-sensing node doesn’t sense already started transmn at other node (Visible in space-time diagram). Taking-turns prots: Polling prots: master node
polls other nodes in round-robin fashion. Prot has polling delay. If master node fails: entire channel inactive. Token-passing prot: Token frame passed node-node. Node can only send if it has token. Highly efficient.
Problems: if 1 node fails or if token lost or not released entire channel crashes. LAN: 2 classes: Ethernet (802.3), token passing (token ring 802.5 and FDDI (fiber distributed data interface)). LAN (MAC, physical,
Ethernet) address: 6B long expressed in hex. LAN broadcast address is all 1’s (FF-FF…FF). ARP: translates betw network- (IP) and link-layer (LAN) addresses only for nodes on same LAN. If LAN addr for IP not in
table: send ARP pckt: query all other nodes (broadcast to FF…FF) to determine LAN addr corresponding to IP. Node w/ match sends reply. If pckt for other network: LAN addr = addr of router. Ethernet: Completely
decentralized: low cost. Invented mid 70s. Frame structure: Data field: 46-1500B, carries IP datagram. Maximum Transfer Unit 1500B. Dest addr: 6B. contains LAN addr. Src addr: 6B. Type field: permits Ethernet to
“(de-)multiplex” netw-lyr prots. Analogous to prot field in netw-lyr datagram and port # field in transp-lyr segm. CRC: 4B. Preamble: 8B. First 7B all 10101010, last 10101011. To wake up receiver and synch clocks. 11
means important stuff now coming, so next 6B is dest addr. Ethernet provides connectionless(analogous to IP and UDP) unreliable service. Uses baseband transmission and Manchester encoding (physical lyr oprtn): 1
has transition from up to down, 0 vice versa, used to synch clocks. CSMA/CD: Eff can approach 100% when prop delay small. Adapters sense other transm and coll by measuring voltage lvls. Prot works as follows: 1:
adapter preps Ethernet frame and puts in adptr buffer. 2: If idle: transmit. If busy: wait until no signal + 96 bit times. 3: monitor until transm finished. 4: if sense signal nrg during trans: stop and send 48 bit jam signal. 5:
after transmn of jam: exponential backoff: after nth coll choose K random from {0,1,…2m-1} (m=min(n,10)), wait K*512 bit times. Efficiency= 1/(1+5tprop/ttrans). 10Base2: coax bus, max 185m and 30 nodes. 10BaseT &
100BaseT: twisted star. Max to hub 100m. 100BaseT doesn’t use Manchester but more efficient 4B5B (every group of five clock periods used to send 4bits to provide enough transitions for synch). Gigabit: fiber/twis-
ted. IEEE 802.3z. Able to run over cat5. Point to point using switches, or shared broadcast using hubs. 10 Gigabit: 802.3ae extends Ethernet to point-to-point WAN links.

Potrebbero piacerti anche