Computer Networks & Security 2014/2015 IP Protocol Stack & Application Layer (02a) Security and Embedded Networked Systems
time Protocols A human analogy All Internet communication is governed by protocols! Slide 2
Problem: Networks are complex! A lot of protocols on different levels! many pieces : hosts routers links of various media applications protocols Given all this complexity, how to organize the structure of a network? LAYERING does the trick!!! Slide 3
Internet protocol stack application: supporting network applications e.g. FTP (file transfer), SMTP (e-mail), HTTP (www) transport: process-to-process data transfer TCP, UDP network: source-to-destination data routing Internet Protocol (IP), routing protocols link: data transfer between neighboring network elements PPP, Ethernet physical: bits on the wire application transport network link physical Slide 4
datagram frame Encapsulation source message segment H t H t H n H t H l H n H t M M M M application transport network link physical link physical switch H l H n H n H t H t H t M M M M destination application transport network link physical H n H t router M network link physical Slide 5
How do packet loss and delay occur? Packets queue in router buffers and wait for turn. packet being transmitted (delay) A B packets queueing (delay) free (available) buffer space: arriving packets dropped (loss) if no free buffer space (e.g. when packet arrival rate to router is too high) Slide 6
Four sources of packet delay 1. Nodal processing delay: check bit errors determine output link 2. Queueing delay: waiting time in the queue (at output link) for transmission depends on congestion A transmission propagation B nodal processing queueing Slide 7
Four sources of packet delay (2) 3. Transmission delay: R=link throughput (bps) L=packet length (bits) time to send L bits into link = L/R 4. Propagation delay: d = length of physical link s = propagation speed in medium (~2x10 8 m/sec) propagation delay = d/s A transmission Note: s is very different from R! propagation B nodal processing queueing Slide 8
Nodal delay d nodal d proc d queue d trans d prop d proc = processing delay typically a few microsecs or less d queue = queuing delay depends on congestion d trans = transmission delay = L/R, significant for low-speed links d prop = propagation delay a few microsecs to hundreds of msecs Slide 9
Application Layer application transport network link physical Slide 11
Architectures of networked applications Client-server Peer-to-peer (P2P) Hybrid of client-server and P2P Slide 12
Pure client-server architecture server: always-on permanent IP address clients: make requests to the server may be on/off (connected from time to time) may have dynamic IP addresses do not communicate directly with each other Examples: World-Wide Web, client/server Slide 13
Pure P2P architecture No always-on server Arbitrary end systems that directly communicate Peers connected from time to time and change IP addresses Highly scalable but difficult to manage Examples: BitTorrent,, Popcorn Time (P2P alternative to Netflix, subject to piracy related lawsuits) peer-to-peer Slide 14
Hybrid of P2P and client-server architectures Examples: Online interactive gaming Skype play/stream interactively find opponent, manage session Hybrid architecture Slide 15
Network sockets A process sends/receives messages through its sockets host or server host or server socket: a data structure for maintaining connection data. analogous to a door process controlled by app developer process Sending process shoves message out the door relies on transport infrastructure on the other side of the door socket TCP with buffers, variables Internet socket TCP with buffers, variables controlled by OS Socket API: (1) choice of transport protocol; (2) ability to fix a few parameters Slide 16
Addressing processes To receive messages, a process must have an identifier. Internet: Host device has a unique IP address 32-bit (IPv4) or 128-bit (IPv6) address Example (well-known) port numbers: Web (HTTP) server: 80 Mail (SMTP) server: 25 To send an HTTP message to www.win.tue.nl web server: IP address: 131.155.70.190 Port number: 80 www.win.tue.nl = www.win.tue.nl:80 Slide 17
Transport service an app needs Timing some apps (e.g., Internet telephony, interactive games) require low delay to be effective Services against data loss some apps (e.g., audio) can tolerate some loss other apps (e.g., file transfer, telnet) require 100% reliable data transfer Throughput some apps (e.g., multimedia) require a certain amount of throughput to be effective other apps (e.g. file transfer) make use of what throughput they get Security confidentiality (encryption), data integrity, availability and more. Slide 18
Transport service requirements Application Data loss Throughput Time Sensitive file transfer no loss elastic no e-mail no loss elastic no Web documents no loss elastic no real-time audio/video stored audio/video loss-tolerant loss-tolerant audio: 5kbps-1Mbps video:10kbps-10mbps same as above yes, 100 s msec yes, few secs interactive games loss-tolerant few kbps up yes, 100 s msec instant messaging no loss elastic yes and no Slide 19
Internet transport protocols UDP service: unreliable data transfer between sending and receiving process UDP does not provide connection setup, reliability, flow control, congestion control, timing, throughput guarantee, or security Q: Why bother? Why UDP? TCP service: connection-oriented: setup required between client and server processes reliable transport between sending and receiving process flow control: sender won t overwhelm receiver congestion control: throttle sender when network overloaded does not provide: timing, minimum throughput guarantees, security Slide 20
DNS: Domain Name System People: many identifiers Social security #, name, passport # Internet hosts, routers: IP address (32 bit for IPv4) - used for addressing datagrams name, e.g., www.yahoo.com - used by humans Domain Name System: application-layer protocol (address/name translation) note: core Internet function, implemented as applicationlayer protocol complexity moved to the network edge Question: How to map between IP addresses and domain name? Slide 21
DNS DNS services hostname to IP address translation host aliasing canonical, alias names e.g. enterprise.com www.enterprise.com relay1.west-coast.enterprise.com e.g. www.gmail.com mail.google.com DNS is a distributed database implemented in hierarchy of many name servers Why not centralize DNS? single point of failure distant central database delay maintenance traffic volume doesn t scale! load distribution replicated web servers: set of IP addresses for one canonical name Slide 22
DNS: Distributed, hierarchical database Root DNS Servers Top level domain servers com DNS servers org DNS servers edu DNS servers Authoritative servers yahoo.com DNS servers amazon.com DNS servers pbs.org DNS servers poly.edu DNS servers umass.edu DNS servers Client wants IP for www.amazon.com (a 1 st approach): client queries a root server to find com DNS server client queries com DNS server to get amazon.com DNS server client queries amazon.com DNS server to get IP address for www.amazon.com Slide 23
A better (2 nd ) approach: Use a Local Name Server Also called Default Name Server Does not strictly belong to the hierarchy Each ISP (residential ISP, company, university) has one. When host makes DNS query, query is sent to its local name server acts as proxy forwards query into hierarchy if no answer is found. Slide 26
DNS name resolution example Host at cis.poly.edu wants IP address for gaia.cs.umass.edu Recursive query: contacted server takes over the task of name resolution Iterated query: contacted server replies with name of server to contact I don t know this name, but ask this server local DNS server dns.poly.edu 1 2 8 requesting host cis.poly.edu 3 4 5 7 gaia.cs.umass.edu root DNS server TLD DNS server 6 authoritative DNS server dns.cs.umass.edu Slide 27
DNS name resolution example All recursive queries: puts burden of name resolution on contacted name server heavy load 2 7 root DNS server 3 6 TLD DNS server local DNS server dns.poly.edu 5 4 1 8 requesting host cis.poly.edu authoritative DNS server dns.cs.umass.edu gaia.cs.umass.edu Slide 28
Summary The internet protocol stack is there to deal with complexity reduce dependencies of different layers We also looked at principles of network application protocols, transport-layer service models, and supporting architectural models client-server architecture peer-to-peer architecture Check the textbook for other example client-server (HTTP, FTP, SMTP) and peer-to-peer (BitTorrent) protocols. Slide 29