Computer Networks Instructor Mohsen Afsharchi Office E122 Email

  • Slides: 67
Download presentation
Computer Networks Instructor: Mohsen Afsharchi Office: E-122 Email: afsharchim@znu. ac. ir Class Location: Lectures:

Computer Networks Instructor: Mohsen Afsharchi Office: E-122 Email: afsharchim@znu. ac. ir Class Location: Lectures: S, Tu 10: 00 – 11: 30 Notes derived from “Computer Networking: A Top Down Approach Featuring the Internet”, 2005, 3 rd edition, Jim Kurose, Keith Ross, Addison-Wesley. Slides are adapted from the companion web site of the book. 1

Roadmap Ø What is a Computer Network? Ø Applications of Networking Ø Classification of

Roadmap Ø What is a Computer Network? Ø Applications of Networking Ø Classification of Networks Ø Layered Architecture Ø Network Core Ø Delay & loss in packet-switched networks Ø Internet Structure Ø Transmission Media Ø History 2

Computer Network? q “interconnected collection of autonomous computers connected by a single technology” [Tanenbaum]

Computer Network? q “interconnected collection of autonomous computers connected by a single technology” [Tanenbaum] q What is the Internet? m “network of networks” m “collection of networks interconnected by routers” m “a communication medium used by millions” m Email, chat, Web “surfing”, streaming media q Internet Web 3

The “nuts and bolts” view of the Internet q millions of connected computing devices:

The “nuts and bolts” view of the Internet q millions of connected computing devices: hosts, end-systems m m PCs workstations, servers PDAs phones, toasters router server m mobile local ISP running network apps q communication links m workstation regional ISP fiber, copper, radio, satellite Links have different bandwidth q routers: forward packets q Packet: a piece of messg. company network 4

Roadmap Ø What is a Computer Network? Ø Applications of Networking Ø Classification of

Roadmap Ø What is a Computer Network? Ø Applications of Networking Ø Classification of Networks Ø Layered Architecture Ø Network Core Ø Delay & loss in packet-switched networks Ø Internet Structure Ø Transmission Media (Wednesday tutorial) Ø History (Monday tutorial) 5

Applications (1) q end systems (hosts): m m m run application programs e. g.

Applications (1) q end systems (hosts): m m m run application programs e. g. Web, email at “edge of network” q client/server model m m client host requests, receives service from always-on server e. g. Web browser/server; email client/server q Client/server model is applicable in an intranet. 6

Applications (2) q peer-peer model: m m No fixed clients or servers Each host

Applications (2) q peer-peer model: m m No fixed clients or servers Each host can act as both client & server q Examples: Napster, Gnutella, Ka. Za. A, Bit. Torrent 7

Applications (3) q WWW q Instant Messaging (Internet chat, text messaging on cellular phones)

Applications (3) q WWW q Instant Messaging (Internet chat, text messaging on cellular phones) q Peer-to-Peer q Internet Phone q Video-on-demand q Distributed Games q Remote Login (SSH client, Telnet) q File Transfer 8

“Cool” Appliances IP picture frame http: //www. ceiva. com/ Web-enabled toaster+weather forecaster 9

“Cool” Appliances IP picture frame http: //www. ceiva. com/ Web-enabled toaster+weather forecaster 9

Roadmap Ø What is a Computer Network? Ø Applications of Networking Ø Classification of

Roadmap Ø What is a Computer Network? Ø Applications of Networking Ø Classification of Networks Ø Layered Architecture Ø Network Core Ø Delay & loss in packet-switched networks Ø Internet Structure Ø Transmission Media (Wednesday tutorial) Ø History (Monday tutorial) 10

A Classification of Networks q Local Area Network (LAN) q Metropolitan Area Network (MAN)

A Classification of Networks q Local Area Network (LAN) q Metropolitan Area Network (MAN) q Wide Area Network (WAN) q Wireless LANs & WANs q Home Networks 11

Local Area Network (LAN) q company/univ local area network (LAN) connects end system to

Local Area Network (LAN) q company/univ local area network (LAN) connects end system to edge router q Ethernet: m shared or dedicated link connects end system and router m 10 Mbs, 100 Mbps, Gigabit Ethernet q deployment: institutions, home LANs happening now q LANs: chapter 5 12

Metropolitan Area Network (MAN) A Cable TV Network is an example of a MAN

Metropolitan Area Network (MAN) A Cable TV Network is an example of a MAN Typically 500 to 5, 000 homes cable headend cable distribution network (simplified) home 13

Cable Network Architecture: Overview cable headend cable distribution network (simplified) home 14

Cable Network Architecture: Overview cable headend cable distribution network (simplified) home 14

Cable Network Architecture: Overview server(s) cable headend cable distribution network home 15

Cable Network Architecture: Overview server(s) cable headend cable distribution network home 15

Wide Area Network (WAN) q Spans a large geographic area, e. g. , a

Wide Area Network (WAN) q Spans a large geographic area, e. g. , a country or a continent q A WAN consists of several transmission lines and routers q Internet is an example of a WAN 16

Wireless Networks q shared wireless access network connects end system to router m via

Wireless Networks q shared wireless access network connects end system to router m via base station aka “access point” q wireless LANs: m 802. 11 b (Wi. Fi): 11 Mbps To the wired network router base station q wider-area wireless access mobile hosts 17

Home networks Typical home network components: q ADSL or cable modem q router/firewall/NAT q

Home networks Typical home network components: q ADSL or cable modem q router/firewall/NAT q Ethernet q wireless access point to/from cable headend cable modem router/ firewall Ethernet (switched) wireless laptops wireless access point 18

“internetworking”? q internetwork – interconnection of networks – also called an “internet” q Subnetwork

“internetworking”? q internetwork – interconnection of networks – also called an “internet” q Subnetwork – a constituent of an internet q Intermediate system – a device used to connect two networks allowing hosts of the networks to correspond with each other m Bridge m Routers q Internet is an example of an internetwork. 19

Roadmap Ø What is a Computer Network? Ø Applications of Networking Ø Classification of

Roadmap Ø What is a Computer Network? Ø Applications of Networking Ø Classification of Networks Ø Layered Architecture Ø Network Core Ø Delay & loss in packet-switched networks Ø Internet Structure Ø Transmission Media (Wednesday tutorial) Ø History (Monday tutorial) 20

Layered Architecture: Why? q Networks are complex with many pieces m Hosts, routers, links,

Layered Architecture: Why? q Networks are complex with many pieces m Hosts, routers, links, applications, protocols, hardware, software q Can we organize it, somehow? q Let’s consider a Web page request: m Browser requests Web page from server m Server should determine if access is privileged m Reliable transfer page from server to client m Physical transfer of “bits” from server to client 21

Motivation Continued … Application Services Communication Service Network Services Web Server Application logic Reliable

Motivation Continued … Application Services Communication Service Network Services Web Server Application logic Reliable delivery Transfer “bits” Application Services Communication Service Network Services Web Client 22

Motivation Continued … Dealing with complex systems: q explicit structure allows identification, relationship of

Motivation Continued … Dealing with complex systems: q explicit structure allows identification, relationship of complex system’s pieces m layered reference model for discussion q modularization eases maintenance, updating of system m change of implementation of layer’s service transparent to rest of system m e. g. , change in gate procedure doesn’t affect rest of system q layering considered harmful? 23

Layers, Protocols, Interfaces Application Services Application logic protocol Application Services Communication Service Reliable delivery

Layers, Protocols, Interfaces Application Services Application logic protocol Application Services Communication Service Reliable delivery protocol Communication Service Network Services Transfer “bits” protocol Network Services Layer Interface Web Server Web Client 24

Layered Architecture (Review 1/2) q Networks organized as a stack of layers? m The

Layered Architecture (Review 1/2) q Networks organized as a stack of layers? m The purpose of a layer is to offer services to the layer above it using an interface (programming language analogy: libraries hide details while providing a service) m Reduces design complexity q Protocols: peer-to-peer layer-n conversations q Data Transfer: each layer passes data & control information to the layer below; eventually physical medium is reached. 25

Review (2/2) q A set of layers & protocols is called a Network Architecture.

Review (2/2) q A set of layers & protocols is called a Network Architecture. These specifications enable hardware/software developers to build systems compliant with a particular architecture. m E. g. , TCP/IP, OSI 26

Layering: Design Issues q Identify senders/receivers? m Addressing q Unreliable physical communication medium? m

Layering: Design Issues q Identify senders/receivers? m Addressing q Unreliable physical communication medium? m Error detection m Error control m Message reordering q Sender can swamp the receiver? m Flow control q Multiplexing/Demultiplexing 27

Reference Models q Open Systems Interconnection (OSI) Model q TCP/IP Model 28

Reference Models q Open Systems Interconnection (OSI) Model q TCP/IP Model 28

Reference Models (2) 29

Reference Models (2) 29

TCP/IP Model: History q Originally used in the ARPANET q ARPANET required networks using

TCP/IP Model: History q Originally used in the ARPANET q ARPANET required networks using leased telephone lines & radio/satellite networks to interoperate q Goals of the model are: m Seamless interoperability m Wide-ranging applications m Fault-tolerant to some extent Application Transport Internet Host-to. Network 30

The Application Layer q Residence of network applications and their application control logic q

The Application Layer q Residence of network applications and their application control logic q Examples include: m HTTP m FTP m Telnet m SMTP m DNS 31

The Transport Layer q Concerned with end-to-end data transfer between end systems (hosts) q

The Transport Layer q Concerned with end-to-end data transfer between end systems (hosts) q Transmission unit is called segment q TCP/IP networks such as the Internet provides two types of services to applications m “connection-oriented” service – Transmission Control Protocol (TCP) m “connectionless” service - User Datagram Protocol (UDP) 32

TCP: Connection-oriented Service q Handshaking between client & server programs m Parameters for ensuing

TCP: Connection-oriented Service q Handshaking between client & server programs m Parameters for ensuing exchange m Maintain connection-state q Packet switches do not maintain any connection-state; m hence “connection-oriented” q Similar to a phone conversation q TCP is bundled with reliability, congestion control, and flow control. 33

UDP: Connectionless Service q No handshaking q Send whenever and however you want q

UDP: Connectionless Service q No handshaking q Send whenever and however you want q A “best effort” service m No reliability m No congestion & flow control services q Why is it needed? 34

The Internet Layer q End systems inject datagrams in the networks q A transmission

The Internet Layer q End systems inject datagrams in the networks q A transmission path is determined for each packet (routing) q A “best effort” service m Datagrams might be lost m Datagrams might be arrive out of order q Analogy: Postal system 35

The Host-to-Network Layer q Somehow, host has to connect to the network and be

The Host-to-Network Layer q Somehow, host has to connect to the network and be able to send IP Datagrams q How? 36

Internet protocol stack q application: supporting network applications m FTP, SMTP, STTP application q

Internet protocol stack q application: supporting network applications m FTP, SMTP, STTP application q transport: host-host data transfer m TCP, UDP transport q network: routing of datagrams from network source to destination m IP, routing protocols q link: data transfer between neighboring network elements m link physical PPP, Ethernet q physical: bits “on the wire” 37

Layering: logical communication Each layer: q distributed q “entities” implement layer functions at each

Layering: logical communication Each layer: q distributed q “entities” implement layer functions at each node q entities perform actions, exchange messages with peers application transport network link physical application transport network link physical 38

Layering: logical communication q take data from app q generate “segment” according to transport

Layering: logical communication q take data from app q generate “segment” according to transport protocol q addressing, reliability check info to form “datagram” q send datagram to peer q wait for peer to ack receipt data application transport network link physical ack data network link physical application transport network link physical data application transport network link physical 39

Layering: physical communication data application transport network link physical application transport network link physical

Layering: physical communication data application transport network link physical application transport network link physical data application transport network link physical 40

Protocol layering and data Each layer takes data from above q adds header information

Protocol layering and data Each layer takes data from above q adds header information to create new data unit q passes new data unit to layer below source M Ht M Hn Ht M Hl Hn Ht M application transport network link physical destination application Ht transport Hn Ht network Hl Hn Ht link physical M message M segment M datagram M frame 41

Roadmap Ø What is a Computer Network? Ø Applications of Networking Ø Classification of

Roadmap Ø What is a Computer Network? Ø Applications of Networking Ø Classification of Networks Ø Layered Architecture Ø Network Core Ø Delay & loss in packet-switched networks Ø Internet Structure Ø Transmission Media (Wednesday tutorial) Ø History (Monday tutorial) 42

The Network Core q mesh of interconnected routers q the fundamental question: how is

The Network Core q mesh of interconnected routers q the fundamental question: how is data transferred through net? m circuit switching: dedicated circuit per call: telephone net m packet-switching: data sent thru net in discrete “chunks” 43

Network Core: Circuit Switching End-to-end resources reserved for “call” q Link bandwidth, switch q

Network Core: Circuit Switching End-to-end resources reserved for “call” q Link bandwidth, switch q q capacity Dedicated resources with no sharing Guaranteed transmission capacity Call setup required “Blocking” may occur 44

Network Core: Circuit Switching q Capacity of medium exceeds the capacity required for transmission

Network Core: Circuit Switching q Capacity of medium exceeds the capacity required for transmission of a single signal m How can we improve “efficiency”? Let’s multiplex. q Divide link bandwidth into “pieces”: m frequency division - FDMA m time division – TDMA 45

Circuit Switching: FDMA and TDMA Example: FDMA 4 users frequency time TDMA frequency time

Circuit Switching: FDMA and TDMA Example: FDMA 4 users frequency time TDMA frequency time 46

Network Core: Packet Switching q “store-and-forward” transmission q source breaks long messages into smaller

Network Core: Packet Switching q “store-and-forward” transmission q source breaks long messages into smaller “packets” q packets share network resources q each packet uses full link bandwidth q resource contention m aggregate resource demand can exceed amount available m congestion: packets queue, wait for link use 47

Packet Switching: Statistical Multiplexing 10 Mbs Ethernet A B statistical multiplexing C 1. 5

Packet Switching: Statistical Multiplexing 10 Mbs Ethernet A B statistical multiplexing C 1. 5 Mbs queue of packets waiting for output link D E Sequence of A & B packets does not have fixed pattern statistical multiplexing. In TDM each host gets same slot in revolving TDM frame. 48

Packet switching versus circuit switching Is packet switching a “slam dunk” winner? q Great

Packet switching versus circuit switching Is packet switching a “slam dunk” winner? q Great for bursty data m resource sharing q Excessive congestion: packet delay and loss m protocols needed for reliable data transfer, congestion control q Q: How to provide circuit-like behavior? m bandwidth guarantees needed for audio/video apps m still an unsolved problem (chapter 6) 49

Packet-switching: store-and-forward L R q Takes L/R seconds to R transmit (push out) packet

Packet-switching: store-and-forward L R q Takes L/R seconds to R transmit (push out) packet of L bits on to link or R bps q Entire packet must arrive at router before it can be transmitted on next link: store and forward q delay = 3 L/R R Example: q L = 7. 5 Mbits q R = 1. 5 Mbps q delay = 15 sec 50

Packet Switching: Message Segmenting Now break up the message into 5000 packets q Each

Packet Switching: Message Segmenting Now break up the message into 5000 packets q Each packet 1, 500 bits q 1 msec to transmit packet on one link q pipelining: each link works in parallel q Delay reduced from 15 sec to 5. 002 sec 51

Packet-switched networks: forwarding q datagram network: m destination address in packet determines next hop

Packet-switched networks: forwarding q datagram network: m destination address in packet determines next hop m routes may change during session (flexible? ) m no “per flow” state, hence more scalable q virtual circuit network: m each packet carries tag (virtual circuit ID), tag determines next hop m fixed path determined at call setup time m path is not a dedicated path as in circuit switched (i. e. , store & forward of packets) m routers maintain per-call state q datagram networks need per packet routing. 52

Network Taxonomy Telecommunication networks Circuit-switched networks FDM TDM Packet-switched networks Networks with VCs Datagram

Network Taxonomy Telecommunication networks Circuit-switched networks FDM TDM Packet-switched networks Networks with VCs Datagram Networks 53

Roadmap Ø What is a Computer Network? Ø Applications of Networking Ø Classification of

Roadmap Ø What is a Computer Network? Ø Applications of Networking Ø Classification of Networks Ø Layered Architecture Ø Network Core Ø Delay & loss in packet-switched networks Ø Internet Structure Ø Transmission Media (Wednesday tutorial) Ø History (Monday tutorial) 54

How do loss and delay occur? packets queue in router buffers q packet arrival

How do loss and delay occur? packets queue in router buffers q packet arrival rate to link exceeds output link capacity q packets queue, wait for turn q if queue is full, arriving packets dropped (Drop-Tail) packet being transmitted (delay) A B packets queueing (delay) free (available) buffers: arriving packets dropped (loss) if no free buffers 55

Four sources of packet delay q 1. nodal processing: m check bit errors m

Four sources of packet delay q 1. nodal processing: m check bit errors m determine output link q 2. queueing m time waiting at output link for transmission m depends on congestion level of router transmission A propagation B nodal processing queueing 56

Delay in packet-switched networks 3. Transmission delay: q R=link bandwidth (bps) q L=packet length

Delay in packet-switched networks 3. Transmission delay: q R=link bandwidth (bps) q L=packet length (bits) q time to send bits into link = L/R transmission A 4. Propagation delay: q d = length of physical link q s = propagation speed in medium (~2 x 108 m/sec) q propagation delay = d/s Note: s and R are very different quantities! propagation B nodal processing queueing 57

Nodal delay q dproc = processing delay m typically a few microsecs or less

Nodal delay q dproc = processing delay m typically a few microsecs or less q dqueue = queuing delay m depends on congestion q dtrans = transmission delay m = L/R, significant for low-speed links q dprop = propagation delay m a few microsecs to hundreds of msecs 58

Queueing delay (revisited) q R=link bandwidth (bps) q L=packet length (bits) q a=average packet

Queueing delay (revisited) q R=link bandwidth (bps) q L=packet length (bits) q a=average packet arrival rate traffic intensity = La/R q La/R ~ 0: average queueing delay small q La/R -> 1: delays become large q La/R > 1: more “work” arriving than can be serviced, average delay infinite! 59

“Real” Internet delays and routes q What do “real” Internet delay & loss look

“Real” Internet delays and routes q What do “real” Internet delay & loss look like? q Traceroute program: provides delay measurement from source to router along end-end Internet path towards destination. For all i: m m m sends three packets that will reach router i on path towards destination router i will return packets to sender times interval between transmission and reply. 3 probes 60

Roadmap Ø What is a Computer Network? Ø Applications of Networking Ø Classification of

Roadmap Ø What is a Computer Network? Ø Applications of Networking Ø Classification of Networks Ø Layered Architecture Ø Network Core Ø Delay & loss in packet-switched networks Ø Internet Structure Ø Transmission Media (Wednesday tutorial) Ø History (Monday tutorial) 61

Internet structure: network of networks q roughly hierarchical q at center: “tier-1” ISPs (e.

Internet structure: network of networks q roughly hierarchical q at center: “tier-1” ISPs (e. g. , UUNet, BBN/Genuity, Sprint, AT&T), national/international coverage m treat each other as equals Tier-1 providers interconnect (peer) privately Tier 1 ISP NAP Tier-1 providers also interconnect at public network access points (NAPs) Tier 1 ISP 62

Tier-1 ISP: e. g. , Sprint US backbone network 63

Tier-1 ISP: e. g. , Sprint US backbone network 63

Internet structure: network of networks q “Tier-2” ISPs: smaller (often regional) ISPs m Connect

Internet structure: network of networks q “Tier-2” ISPs: smaller (often regional) ISPs m Connect to one or more tier-1 ISPs, possibly other tier-2 ISPs Tier-2 ISP pays tier-1 ISP for connectivity to rest of Internet q tier-2 ISP is customer of tier-1 provider Tier-2 ISP Tier 1 ISP Tier-2 ISP NAP Tier 1 ISP Tier-2 ISPs also peer privately with each other, interconnect at NAP Tier-2 ISP 64

Internet structure: network of networks q “Tier-3” ISPs and local ISPs m last hop

Internet structure: network of networks q “Tier-3” ISPs and local ISPs m last hop (“access”) network (closest to end systems) local ISP Local and tier 3 ISPs are customers of higher tier ISPs connecting them to rest of Internet Tier 3 ISP Tier-2 ISP local ISP Tier-2 ISP Tier 1 ISP Tier-2 ISP local ISP NAP Tier 1 ISP Tier-2 ISP local ISP 65

Internet structure: network of networks q a packet passes through many networks! local ISP

Internet structure: network of networks q a packet passes through many networks! local ISP Tier 3 ISP Tier-2 ISP local ISP Tier-2 ISP Tier 1 ISP Tier-2 ISP local ISP NAP Tier 1 ISP Tier-2 ISP local ISP 66

Introduction: Summary Covered a “ton” of material! q Internet overview q what’s a protocol?

Introduction: Summary Covered a “ton” of material! q Internet overview q what’s a protocol? q network edge, core, access network m packet-switching versus circuit-switching q Internet/ISP structure q performance: loss, delay q layering and service models q history (which you will be reading on your own) You now have: q context, overview, “feel” of networking q more depth, detail to follow! 67