root DNS server DNS Infrastructure 2 • Host at liu.se wants IP 3 TLD DNS server address for 4 gaia.cs.umass.edu 5 • Infrastructure: local DNS server – Client resolver dns.liu.se – Local DNS server 6 7 1 8 – Authoritative DNS Server – Root DNS Server authoritative DNS server – Top-Level Domain DNS Server dns.cs.umass.edu requesting host • Transport protocol? example.liu.se – UDP (port: 53) gaia.cs.umass.edu 49
DNS Records
Inserting Records into DNS Authoritative name server , mail server
Roadmap • Principles of Network Applications – App Architectures – App Requirements • Web and HTTP • FTP • Electronic Mail – SMTP, POP3, IMAP • DNS • P2P Applications • Socket Programming with UDP and TCP
Socket Programming
Socket Programming
Socket Programming with UDP • UDP: no “connection” between client & server – no handshaking before sending data – sender explicitly attaches IP destination address and port # to each packet – rcvr extracts sender IP address and port# from received packet • UDP: transmitted data may be lost or received out-of-order • Application viewpoint: – UDP provides unreliable transfer of groups of bytes (“datagrams”) between client and server
Client/Server Socket Interaction: UDP Address family: IPv4, Socket type: datagrams UDP
Socket Programming with TCP
Client/Server Socket Interaction: TCP Wait for new connections on serversocket
Transport Layer
Transport Services and Protocols
Transport vs. Network Layer
Two Basic Transport Features • Demultiplexing: port numbers Server host 128.2.194.242 Service request for Client host Web server 128.2.194.242:80 (port 80) (i.e., the Web server) OS Client Echo server (port 7) • Error detection: checksums IP payload 62 detect corruption
Demultiplexing Traffic Server applications communicate with Host 1 Host 2 Host 3 multiple clients Unique port for Application each application Applications share the same network Transport P1 P2 P3 P4 P5 P6 P7 Network Endpoints identified by <src_ip, src_port, dest_ip, dest_port> 63
Two Main Transport Layers • User Datagram Protocol (UDP) – Just provides demultiplexing and error detection – Header fields: port numbers, checksum, and length – Low overhead, good for query/response and multimedia • Transmission Control Protocol (TCP) – Adds support for a “ stream of bytes ” abstraction – Retransmitting lost or corrupted data – Putting out-of-order data back in order – Preventing overflow of the receiver buffer – Adapting the sending rate to alleviate congestion – Higher overhead, good for most statefull applications 64
Network Layer
Network Layer
Two Key Network Layer Functions
Interplay between Routing and Forwarding
Network Layer Service Model
How do we find a path?
Routing on a Graph • Goal: determine a “good” path through the network from source to destination • What is a good path? 5 – Usually means the shortest path 3 B C – Load balanced 5 2 – Lowest $$$ cost 2 1 A F 3 • Network modeled as a graph 2 1 D E – Routers nodes 1 – Link edges • Edge cost: delay, congestion level, etc.
Hierarchical addressing: route aggregation ISP has an address block; it can further divide this block into sub blocks and assign them to subscriber organizations. Organization 0 200.23.16.0/23 Organization 1 “Send me anything 200.23.18.0/23 with addresses beginning Organization 2 . 200.23.16.0/20” 200.23.20.0/23 Fly-By-Night-ISP . . . . Internet . Organization 7 200.23.30.0/23 “Send me anything ISPs-R-Us with addresses beginning 199.31.0.0/16” 72
Link Layer
Link Layer
Link Layer
Where is the link layer implemented?
Adaptors Communicating
MAC Addresses(2/3) Each adapter on LAN has unique LAN address Broadcast address = 1A-2F-BB-76-09-AD FF-FF-FF-FF-FF-FF LAN (wired or = adapter wireless) 71-65-F7-2B-08-53 58-23-D7-FA-20-B0 0C-C4-11-6F-E3-98 78
LAN Address (3/3) • MAC address allocation administered by IEEE • manufacturer buys portion of MAC address space • MAC flat address provides portability – can move LAN card from one LAN to another – different than with IP addresses! 79
Address Resolution Protocol (ARP) • Every host maintains an ARP table – (IP address, MAC address) pair • Consult the table when sending a packet – Map destination IP address to destination MAC address – Encapsulate and transmit the data packet • But, what if the IP address is not in the table? – Sender broadcasts: “ Who has IP address 1.2.3.156? ” – Receiver responds: “ MAC address 58-23-D7-FA-20-B0 ” – Sender caches the result in its ARP table 80
ARP: Address Resolution Protocol Question: how to determine • Each IP node (Host, Router) MAC address of B on LAN has ARP table knowing B’s IP address? • ARP Table: IP/MAC address mappings for some LAN 237.196.7.78 nodes 1A-2F-BB-76-09-AD < IP address; MAC address; TTL> 237.196.7.23 TTL (Time To Live): time after – 237.196.7.14 which address mapping will LAN be forgotten (typically 20 min) 71-65-F7-2B-08-53 58-23-D7-FA-20-B0 0C-C4-11-6F-E3-98 237.196.7.88 81
Link Layer Services
Link Layer Services
Connecting the pieces
Three Kinds of Identifiers (+ports) Host Name IP Address MAC Address Example www.cs.princeton.edu 128.112.7.156 00-15-C5-49-04-A9 Size Hierarchical, human Hierarchical, Flat, machine readable, variable machine readable, readable, 48 bits length 32 bits (in IPv4) Read by Humans, hosts IP routers Switches in LAN Allocation, Domain, assigned Variable-length Fixed-sized blocks, top-level by registrar (e.g., for prefixes, assigned by assigned by IEEE to .edu) ICANN, RIR, or ISP vendors (e.g., Dell) Allocation, Host name, local Interface, by DHCP Interface, by vendor low-level administrator or an administrator 86
Learning a Host ’ s Address me you adapter adapter • Who am I? – Hard-wired: MAC address – Static configuration: IP interface configuration – Dynamically learned: IP address configured by DHCP • Who are you? – Hard-wired: IP address in a URL, or in the code – Dynamically looked up: ARP or DNS 87
Mapping Between Identifiers • Dynamic Host Configuration Protocol (DHCP) – Given a MAC address, assign a unique IP address – … and tell host other stuff about the Local Area Network – To automate the boot-strapping process • Address Resolution Protocol (ARP) – Given an IP address, provide the MAC address – To enable communication within the Local Area Network • Domain Name System (DNS) – Given a host name, provide the IP address – Given an IP address, provide the host name 88
Dynamic Host Configuration Protocol arriving client DHCP server Host learns IP address, Subnet mask, Gateway address, DNS server(s), and a lease time. 89
Courses about Computer Networks • TDTS06 Computer Networks (6hp) – D program: Recommended elective … • TDDE35 Large-scale Systems (11hp) – U program: Second year course covering computer networking, distributed systems, multicore, embedded systems, and a project • TDTS21 Advance Networking (6p) – Pre-requirement: Introductory networking course; e.g., TDDE35 (U), TDTS04 (IP, C, …), TDTS06 (D, Y, …), TDTS11 (IT) • Thesis opportunities – Companies often have projects – I have research projects (on these and related topics, including novel multimedia streaming solutions, cloud, IoT, data analytics/mining, network security, social networking, …)
Extra slides …
FTP: Commands and Responses
Socket Programming
Socket Programming
Socket Programming with UDP • UDP: no “connection” between client & server – no handshaking before sending data – sender explicitly attaches IP destination address and port # to each packet – rcvr extracts sender IP address and port# from received packet • UDP: transmitted data may be lost or received out-of-order • Application viewpoint: – UDP provides unreliable transfer of groups of bytes (“datagrams”) between client and server
Client/Server Socket Interaction: UDP Address family: IPv4, Socket type: datagrams UDP
Example App: UDP Client
Recommend
More recommend