400 likes | 412 Views
Learn principles of computer networks, Internet structure, implement network protocols and applications, and have fun exploring data communications and networking. Get insight into the 1999 Internet snapshot!
E N D
School of Computing Science Simon Fraser University CMPT 371: Data Communications and Networking Review
Course Objectives • Understand principles of designing and operating computer networks, • Understand the structure and protocols of the largest network of networks (Internet), • Know how to implement network protocols and networked applications, and … • Have fun!
a packet passes through many networks! Tier 3 ISP local ISP local ISP local ISP local ISP local ISP local ISP local ISP local ISP NAP Tier-2 ISP Tier-2 ISP Tier-2 ISP Tier-2 ISP Tier-2 ISP Internet structure: packet journey Tier 1 ISP Tier 1 ISP Tier 1 ISP
ticket ticket (purchase) baggage (check) gates (load) runway (takeoff) airplane routing ticket (complain) baggage (claim gates (unload) runway (land) airplane routing baggage gate airplane routing airplane routing takeoff/landing airplane routing departure airport intermediate air-traffic control centers arrival airport Layering of airline functionality Layers: each layer implements a service • via its own internal-layer actions • relying on services provided by layer below
application: supporting network applications FTP, SMTP, HTTP transport: host-host data transfer TCP, UDP network: routing of datagrams from source to destination IP, routing protocols link: data transfer between neighboring network elements PPP, Ethernet physical: bits “on the wire” application transport network link physical Internet protocol stack
source network link physical message application transport network link physical segment link physical M M Ht Ht M M switch Hn Hn Hn Hn Ht Ht Ht Ht M M M M Hl Hl Hl Hl Hl Hl Hn Hn Hn Hn Hn Hn Ht Ht Ht Ht Ht Ht M M M M M M destination application transport network link physical router Encapsulation datagram frame
Programs that run on different end systems and communicate over a network. e.g., Web: Web server software communicates with browser software little software written for devices in network core network core devices do not run user application code application on end systems allows for rapid app development, propagation application transport network data link physical application transport network data link physical application transport network data link physical What is a network app?
How to create a network app? • Design application architecture • how to organize the app over end systems • Choose network transport service(s) • which service to use (TCP, UDP) • depends on app requirements (delay, loss, bw, …) • Design app protocol • message types, format, actions, … • Write code • implement the protocol
host or server host or server process process socket socket TCP with buffers, variables TCP with buffers, variables Socket Programming • process sends/receives messages to/from its socket • socket analogous to door • sending process shoves message out door • sending process relies on transport infrastructure on other side of door which brings message to socket at receiving process controlled by app developer Internet controlled by OS • socket is the interface (API) between application and transport layer
Web and HTTP web caching FTP Domain Name System (DNS) Sample app-level protocols
provide logical communication between app processes transport protocols run in end systems send side: breaks app messages into segments, passes to network layer rcv side: reassembles segments into messages, passes to app layer more than one transport protocol available to apps Internet: TCP and UDP application transport network data link physical application transport network data link physical network data link physical network data link physical network data link physical network data link physical network data link physical logical end-end transport Transport layer
rdt_send():called from above, (e.g., by app.). Passed data to deliver to receiver upper layer deliver_data():called by rdt to deliver data to upper udt_send():called by rdt, to transfer packet over unreliable channel to receiver rdt_rcv():called when packet arrives on rcv-side of channel Reliable data transfer: principles send side receive side
Sender: k-bit seq # in pkt header “window” of up to N, consecutive unack’ed pkts allowed Reliable data transfer: Go-Back-N • ACK(n): ACKs all pkts up to, including seq # n - “cumulative ACK” • may receive duplicate ACKs (see receiver) • timer for each in-flight pkt • timeout(n): retransmit pkt n and all higher seq # pkts in window • i.e., go back to n
full duplex data: bi-directional data flow in same connection MSS: maximum segment size connection-oriented: handshaking (exchange of control msgs) init’s sender, receiver state before data exchange flow controlled: sender will not overwhelm receiver point-to-point: one sender, one receiver reliable, in-order byte steam: no “message boundaries” congestion controlled: will not overwhelm network send & receive buffers TCP: OverviewRFCs: 793, 1122, 1323, 2018, 2581
TCP Congestion Control: Summary • Initially • Threshold is set to large value (65 Kbytes), has not effect • CongWin = 1 MSS • Slow Start (SS): CongWin grows exponentially • till a loss event occurs (timeout or 3 dup ack) or reaches Threshold • Congestion Avoidance (CA): CongWin grows linearly • 3 duplicate ACK occurs: • Threshold = CongWin/2; CongWin = Threshold; CA • Timeout occurs: • Threshold = CongWin/2; CongWin = 1 MSS; SS till Threshold
transport segment from sending to receiving host on sending side encapsulates segments into datagrams on receiving side, delivers segments to transport layer network layer protocols in every host, router Router examines header fields in all IP datagrams passing through it network data link physical network data link physical network data link physical network data link physical network data link physical network data link physical network data link physical network data link physical application transport network data link physical application transport network data link physical Network layer
Packet-switched networks Circuit-switched networks FDM TDM Datagram Networks Networks with VCs Network Taxonomy Telecommunication networks • Datagram network is neither connection-oriented • nor connectionless. • Internet provides both connection-oriented (TCP) and • connectionless services (UDP) to apps.
routing algorithm local forwarding table header value output link 0100 0101 0111 1001 3 2 2 1 value in arriving packet’s header 1 0111 2 3 Interplay between routing and forwarding
Router Architecture Overview Two key router functions: • run routing algorithms/protocol (RIP, OSPF, BGP) • forward datagrams from incoming to outgoing link
Subnet is: a group of devices that can reach each other without intervening router identified by high order bits of IP addresses 223.1.1.0/24 223.1.2.0/24 223.1.3.0/24 Addressing, Subnets 11011111 00000001 00000001 00000001 HostID Subnet ID 223.1.1.0/24 /24: # bits in subnet portion of address, subnet mask
200.23.16.0/23 200.23.18.0/23 200.23.30.0/23 200.23.20.0/23 . . . . . . Hierarchical addressing: route aggregation Hierarchical addressing allows efficient advertisement of routing information: Organization 0 Organization 1 “Send me anything with addresses beginning 200.23.16.0/20” Organization 2 Fly-By-Night-ISP Internet Organization 7 “Send me anything with addresses beginning 199.31.0.0/16” ISPs-R-Us
5 3 5 2 2 1 3 1 2 1 x z w u y v Routing algorithms: Graph abstraction • cost of link (x1, x2): • Metric value, e.g., c(w,z) = 5 • could be • 1, or • inversely related to bandwidth, or • inversely related to congestion • Cost of path (x1, x2, x3,…, xp) = c(x1,x2) + c(x2,x3) + … + c(xp-1,xp) Routing algorithm: algorithm that finds least-cost path
Global or decentralized information? Global: all routers have complete topology, link cost info “link state” algorithms Decentralized: router knows physically-connected neighbors, link costs to neighbors iterative process of computation, exchange of info with neighbors “distance vector” algorithms Classification of Routing Algorithms
aggregate routers into regions, “autonomous systems” (AS) routers in same AS run same routing protocol “intra-AS” routing protocol routers in different AS can run different intra-AS routing protocol Gateway router Direct link to router in another AS Hierarchical Routing
Forwarding table is configured by both intra- and inter-AS routing algorithm Intra-AS sets entries for internal dests Inter-AS & Intra-As sets entries for external dests 3a 3b 2a AS3 AS2 1a 2c AS1 2b 3c 1b 1d 1c Inter-AS Routing algorithm Intra-AS Routing algorithm Forwarding table Hierarchical Routing
BGP: reachability and policy routing • A,B,C are provider networks • X,W,Y are customer (of provider networks) • X is dual-homed: attached to two provider networks • X does not want to route traffic from B via X to C • .. so X will not advertise to B a route to C
Unicast, multicast, broadcast • Unicast: one source, one destination • E.g., web session • Multicast: one source, multiple destinations • Subset of all possible destinations • E.g., streaming a hockey game to interested fans • Broadcast: one source, all destinations • E.g., broadcasting link state info to ALL routers in a domain in OSPF protocol • Anycast: multiple possible sources, one destination • Sources have same (anycast) address • Request is forwarded to appropriate source • (Still in research phases)
Some terminology: hosts and routers are nodes communication channels that connect adjacent nodes along communication path are links wired links wireless links LANs layer-2 packet is a frame,encapsulates datagram “link” Link Layer data-link layer has responsibility of transferring datagram from one node to adjacent node over a link
link layer implemented in “adaptor” (aka NIC) Ethernet card, PCMCI card, 802.11 card sending side: encapsulates datagram in a frame adds error checking bits, rdt, flow control, etc. receiving side looks for errors, rdt, flow control, etc extracts datagram, passes to rcving node adapter is semi-autonomous link & physical layers frame frame Adaptors Communicating datagram rcving node link layer protocol sending node adapter adapter
r bits d+1 bits CRC: basic idea • Sender and receiver agree on a divisor polynomial G(x) of degree r • Sender: transmits T(x), which consists of d+1 data bits AND r redundant bits such that G(x)|T(x), • i.e., the remainder of dividing T(x) by G(x) is 0 • Receiver: gets T’(x) which may have corrupted bits • If G(x) | T’(x) then no errors occurred
MAC Protocols: a taxonomy Three broad classes: • Channel Partitioning • divide channel into smaller “pieces” (time slots, frequency, code) • allocate piece to node for exclusive use • Random Access • channel not divided, allow collisions • “recover” from collisions • “Taking turns” • Nodes take turns, but nodes with more to send can take longer turns
MAC and IP addresses • Why do we have TWO addresses (IP,MAC)? Do we have to have MAC addresses? • Yes, we must have both • To allow different network-layer protocols over same card (e.g., IP, Novell IPX, DECnet) • Enable flexibility, mobility of cards • Efficiency: imagine that nodes have only IP addresses ALL packets sent over LAN will be forwarded by NIC to the IP layer too many useless interrupts
1. Adaptor receives datagram from net layer & creates frame 2. If adapter senses channel idle, it starts to transmit frame. If it senses channel busy, waits until channel idle and then transmits 3. If adapter transmits entire frame without detecting another transmission, the adapter is done with frame ! 4. If adapter detects another transmission while transmitting, aborts and sends jam signal 5. After aborting, adapter enters exponential backoff: after the mth collision, adapter chooses a K at random from {0,1,2,…,2m-1}. Adapter waits K·512 bit times and returns to Step 2 Ethernet CSMA/CD algorithm
Institutional network mail server to external network web server router switch IP subnet hub hub hub
Point to Point Data Link Control • one sender, one receiver, one link: easier than broadcast link: • no Media Access Control • no need for explicit MAC addressing • e.g., dialup link, ISDN line • popular point-to-point DLC protocols: • PPP (point-to-point protocol) • HDLC: High level data link control
Internetwork layer (IP): • addressing: internetwork appears as a single, uniform entity, despite underlying local network heterogeneity • network of networks The Internet: virtualizing networks Gateway: • “embed internetwork packets in local packet format or extract them” • route (at internetwork level) to next gateway gateway satellite net ARPAnet
If you have passion for networking More networking: CMPT 408 CMPT 471 Some theory: Probability and modeling: CMPT 308 Statistics Algorithms and graph theory Some systems C/C++ coding and Unix OS: CMPT 300 What is next?
That is all! Good luck on your final