Samenvatting_tst

download Samenvatting_tst

of 2

Transcript of Samenvatting_tst

  • 8/8/2019 Samenvatting_tst

    1/2

    Chapter 1: Computer Networks and the Internet. RFC: request for comment, (informal) standard. Define prots. TCP: Transmission Control Prot. Used by Telnet, SMTP, FTP, HTTP. UDP: User DatagramProt. 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-DivisionMultiplexing. 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 andFDM 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 vcnumbers. 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. Switchmaintains 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, usesFDM (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 forshort 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 doesnt.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: solidmedium: 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, 10MbpsEthernet), 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 systemsreceive 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 backbonenetworks. 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: twodirectly connected ISPs. POP: point of presence: point where ISP connects to others. NAP: network access point. Also connect ISPs. Operated by 3rd pty or backbone prov. Processing delay: time req. to examineheader, 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 packets bits onto link. Propagationdelay: 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 processsends 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 programmersinterface): 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 connectionexists. 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. Nocongestion 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 onwebserver. 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 assoon 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 notunderstood by server. 401 Authorization Required. 404 Not found: document doesnt exist on server. 505 HTTP Version Not Supported. Cookies: Can be used to authenticate user. 4 Components: 1 Cookie header linein HTTP response msg, 2 Cookie header line in HTTP request msg, 3 cookie file kept on users end system managed by browser, 4 back-end db at Web site. Conditional GET: If-modified-since header line, exactlyequal 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, thenclosed). FTP sends control info out-of band, HTTP sends control info in-band. FTP must maintainstate about user (keep track of current dir, associate control conn w/ user account). This constrains number of sessionsFTP 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. FTPReplies: 3 digit numbers: 331 Username OK, password required, 125 Data connection already open; transfer starting, 425 Cant 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 ispush protocol. HTTP puts each object in response msg, SMTP places all of msgs objects in 1 msg. MIME: Multipurpose Internet Mail Extensions: extra headers in mail for content other than ASCIItext. 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 byreceiver. Specifies name of sending and receiving SMTP-server and time. POP3: Three phases: authorization (user , pass ), transaction (retrieves msgs), update (after quit command, server deletesmarked 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 tocreate 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 ofname servers(often UNIX running BIND (Berkeley Internet NameDomain) 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 forhostname. 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 IPs associated w/ 1 canonical hostname. DNS responds w/ all IPs, rotates order). DNS decentralizedbecause: No singlepoint 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 hosts isp,always has record for host, queried through authoritative). Recursive queries: a asks b, b asks c, c tells b, b tells aIterative queries: a asks b, b tells a to ask c, a asks c. Query to root is iterative, rest recursive. DNSCaching: 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 authoritativename 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 logicalcomm. betw processes, vs network-layer prot: provides logical comm. betw hosts. Transport layer prots live in end systems; intermediate routers dont recognize transport layer info. Prots UDP (unreliable), TCP(reliable). Both provide transport-layer multiplexingand demultiplexing: extending host-host delivery to process-process del. Each segment has fields forsource port numberand dest. port #.Well known port numbers0-1023 are restricted, rest up to 65535 arent. 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 connectionstate (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 (1s complement of sum of all 16-bit data words in segment, but UDP doesnt 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 unlesssure 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_timerS5: rdt_rcv(rcvpkt) / .

    S6-10 idem but w/ 1s and 0s 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, 1s and 0s 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

  • 8/8/2019 Samenvatting_tst

    2/2

    CongWin and RcvWindow: LastByteSent LastByteAcked min{CongWin, RcvWindow}. TCP congestion control algorithm: 3 major components: 1:AIMD: additive increase (CongWin increased roughly 1 MSSper 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: Slowstart. 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 totimeout 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 beforetimeout. 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 duplicateacks 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 additiveincrease 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 TCPconn until time when entire object received. W= fixed size CongWin (integer denoting # outstanding segments). O = size of object. MSS = Sbits.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 andwait 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. Dynamicwindows 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 1 st segment inwindow until receipt of 1st ack for segment in window) and (S/R)*2 k-1 (transmission time ofkth 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 oftimes 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 startcansignificantly 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 determinationcomponent, 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 distancevector 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 doesnt.Network service modeldefines 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 paths 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 callednetwork 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) dontmaintain state info about VCs because there arent 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 multipleservice 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 thanspecified 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 bitrate (VBR) and Unspecified bit rate (UBR). Datagram vs VC: VC notion principal roots in telephony; complexity w/in network, dumb end systems. Internets datagram has more sophisticated end systems, networklayer 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 servicesadded by attaching host w/ new application-layer prot: new services adopted quickly. Routing protocol:Determines path for a packet. Host is attached directly todefault router: also called first-hop router. Sourcerouter: 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: hascomplete 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 dynamicrouting algorithms: static routes change very slowly, often byhuman 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 costsvary dynamically reflecting congestion in underlying link; Internets 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. Dijkstras algorithm: 1: initialization: currently known least-cost paths to directly attached

    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, thenupdate 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 totalnodes 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: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 Zs currently known minimum-cost path from itself toY, that is Dx(Y,Z) = c(X,Z)+minw{D

    z(Y,w)}. When node computes new minimum cost it must inform neighbours. Forwarding table (indicates which outgoing link for given dest) easilyconstruced from dist table. Bellman-Ford algorithm: used in many routing prots in practice, including Internets RIP, BGP, ISO, IDRP, Novell IPX, ARPAnet. Good news travels fast, bad

    news slow (count to infinity problem). Solution: adding poisoned reverse: if Z routes through Y to get to X, it will tell Y that its 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. UnderLSroute calculations somewhat separated because nodeonly calculates for itself providing degree of robustness, underDV incorrect node calculation can be diffused through entire network. LS and DV are essentially only routing algorithms used in practice today. Hotpotato 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 constrainedoptimization 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 bereserved for each connection. Problems: Organizing routers into regions orAutonomous systems (ASs) solves problem of scale and administrative autonomy (organization wants to run and administer network as itwishes 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 ASand 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-addressis 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 networkaddress 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) 214networks 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 InterdomainRouting (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 ofInternet 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 finaldest 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.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 couldbe 65535 bytes long.Identifier, flags, fragmentation offset: Have to do w/ IP fragmentation. Time-to-live (TTL): included so datagrams dont circulate forever, decremented by 1 each time its 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). Headerchecksum: aids router in detecting bit errs. Calculated by treating each 2 bytes as number, adding numbers and calculating 1s 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, howevermay be ICMP message. Routerarchitecture: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 andforwarding 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 linkand 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, performsnetwork 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. Switchingfabric: 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 onepacket 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 inputports 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 ports mem and transmits them overoutgoing 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 chooseone 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 pcktdropped. Head-of-line (HOL) blocking: queued packet must wait because blocked by other packet at head of line (switch fabric chose other pckt 1 st 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 actionstaken 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 rulesby which frame is transmitted onto link.Reliable delivery: often used for links w/ high error rates (eg wireless), many wired link-layer prots dont offer reliable delivery service. Flow control: Similar to transport layers,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 detectederror. 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), cyclicredundancy 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. 1s complement of sum of k-bit integers. Ifsum of data and checksum not all 1s: 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). Mostsignificant bit of G=1. Sender choosesR (r additional bits (CRC)) and appends them to dataD (d bits) such that d+r bit pattern exactly divisible by G using modulo 2 arithmetic w/o carries and borrows (also in mult anddiv), so addition and subtraction are identical and both are XOR of operands. Receiver divides d+r by G. If remainder nonzero: error. Multiplication by 2 k left shifts bit pattern by k places. Thus, given D and R, D*2 rXOR R yields d+r bit pattern. Want to find R such that there is n such that: D*2 rXOR R = nG. If we XOR (that is add modulo-2 w/o carry) R to both sides: D*2 r= nG XOR R. So if we divide D*2rby 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 candetect 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 transmissioninto 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 decentralizedso 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 senders codeschosen carefully each receiver can recover data sent by given sender. d i=(1/M)*m=1MZi,m**cm (*=sender s, cm=mth bit in assigned CDMA code, d i=data bit, M=# minislots, Z i.m=output of CDMA encoder). Randomaccess 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. Timedivided 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/CDCollision detn: node listens while transm, stops transm if detects another node transm. Channel propagation delay: playscrucial role in performance. If large then larger chance that carrier-sensing node doesnt sense already started transmn at other node (Visible in space-time diagram). Taking-turns prots: Polling prots: master nodepolls 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 1s (FF-FFFF). ARP: translates betw network- (IP) and link-layer (LAN) addresses only for nodes on same LAN. If LAN addr for IP not intable: send ARP pckt: query all other nodes (broadcast to FFFF) to determine LAN addr corresponding to IP. Node w/ match sends reply. If pckt for other network: LAN addr = addr of router. Ethernet: Completelydecentralized: 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. 11means important stuff now coming, so next 6B is dest addr. Ethernet provides connectionless(analogous to IP and UDP)unreliable service. Uses basebandtransmission and Manchesterencoding (physical lyr oprtn): 1has 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 doesnt 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.

    step N D(v),p(v) etc

    Cost via

    DE() A B

    A Odest

    B O

    Destnetw

    Nextrouter

    Nhops (Interface)(only rtr)