Data Communication I Urban Bilstrup (E327) 090901 Urban.Bilstrup@ide.hh.se www2.hh.se/staff/urban
Internet - Sweden, Northern Europe SUNET NORDUnet 2
Internet - Internet Addresses Everyone should be able to address everyone! IP-addresses. Everyone should be able to understand everyone! Internet Protocol. RFC* 791 fibbla 129.16.20.156 (fibbla.ce.chalmers.se) * Request For Comments (RFC) availble at: http:// www.ietf.org/rfc.html 207.200.89.226 (home-v4.websys.aol.com) home-v4 Internet coriolis 3 194.47.1.137 (coriolis.hh.se)
Internet Adress Space Class A IP uses a 32 bits address field, four octets. These four octets are presented as four decimal numbers 0-255. The four octets are divide into a network part and host part. (194.47.1.137) 7 0 7 0 7 0 7 0 0 Net-ID Host-ID 16M hosts each Class B 7 0 7 0 7 0 7 0 1 0 Net-ID Host-ID 65536 host each 0 7 7 0 7 0 7 0 Class C 1 1 0 Net-ID Host-ID 256 hosts each 0 7 7 0 7 0 7 0 Class D 1 1 1 0 Multicast address 0 7 7 0 7 0 7 0 Class E 1 1 1 1 0 reserved for future use 4
Internet - Internet Protocol (IP) 129.16.20.156 (fibbla.ce.chalmers.se) fibbla Stockholm Router Local network Chalmers Router Göteborg Local network Router Router coriolis HH Halmstad Malmö 194.47.1.137 (coriolis.hh.se) 5
Internet Which path did the packet take? coriolis% traceroute 129.16.20.156 traceroute to 129.16.20.156 (129.16.20.156), 30 hops max, 40 byte packets 1 cat5500-1.net.hh.se (194.47.1.1) 1.069 ms 0.696 ms 0.623 ms 2 halmstad-1-fe1-0-0.sunet.se (130.242.201.145) 1.620 ms 0.525 ms 0.418 ms 3 MLM-BB-1-POS1-2.sunet.se (130.242.210.26) 2.027 ms 2.179 ms 2.231 ms 4 STK-BB-1-POS10-0.sunet.se (130.242.204.241) 9.457 ms 9.833 ms 10.823 ms 5 GBG-BB-1-POS4-0.sunet.se (130.242.204.234) 18.576 ms 17.736 ms 18.048 ms 6 chalmers-1-pos4-0-0.sunet.se (130.242.200.110) 18.450 ms 17.907 ms 18.211 ms 7 cth1-gw.sunet.se (130.242.202.86) 120.884 ms 180.229 ms 106.058 ms 8 ed-ge-gw.chalmers.se (129.16.2.102) 19.229 ms 19.085 ms 19.005 ms 9 fibbla.ce.chalmers.se (129.16.20.156) 19.286 ms 19.209 ms 19.479 ms 6
Internet - Internet Protocol Stack Open Systems Interconnection (OSI). International Standard Organization (ISO). Sockets => a interface between the application and the operative system. Application Presentation Session Transport TCP Application UDP Application processes sockets Sockets => a file handle that is used for network communications, it can also be used for inter-process communications in a local host. Network Datalink Physical OSI referens modell IP Link layer Device Driver and Hardware Internet protokollets modell Operative system 7
Internet Port number coriolis% netstat -n 194.47.1.137.43890 129.16.20.156.80 24820 0 8760 0 CLOSE_WAIT 194.47.1.137.43891 129.16.20.156.80 24820 0 8760 0 CLOSE_WAIT P1 P2 43890 43891 Internet 80 P 194.47.1.137 coriolis.hh.se 129.16.20.156 fibbla.ce.chalmers.se 8
Internet Port Numbers Internet Assigned Numbers Authority (IANA) Well known port numbers 0-1023 Registered port numbers 1024-49151 Dynamic or private port numbers 49152-65535 ftp://ftp.isi.edu/in-notes/iana/assignments/port-numbers 9
Internet Some well known port numbers ftp-data 20/tcp File Transfer [Default Data] ftp-data 20/udp File Transfer [Default Data] ftp 21/tcp File Transfer [Control] ftp 21/udp File Transfer [Control] telnet 23/tcp Telnet telnet 23/udp Telnet smtp 25/tcp Simple Mail Transfer smtp 25/udp Simple Mail Transfer domain 53/tcp Domain Name Server domain 53/udp Domain Name Server http 80/tcp World Wide Web HTTP http 80/udp World Wide Web HTTP 10
Internet As long as the information is put into a IP packet the network gets the information that is needed for the packet to find the path from a one computer to another computer. Problem can appear if only IP-protocol is used!!!!! Most data transmissions include more data then can be fit into one IP packet (1500 characters). Sometimes it goes wrong and the network lose a packet. Packets can arrive in wrong orde, it is not sure that two consecutive IP packets take the same way. One packet s path over Internet may be longer then another packet s path, which implies that the order can be wrong at the receiver. 11
Internet - Transport Protocol Application Application processes Presentation Application Session Transport TCP UDP sockets Network Datalink Physical OSI reference model IP Device Driver and Hardware Internet protocol model Operativ system 12
Internet - Transport protocol User Datagram Protocol (UDP) Non connected Do not guarantee packet delivery Do not guarantee the right packet sequence delivery. RFC 768 Transmission Control Protocol (TCP) Connected. Guarantee a packets delivery. Guarantee the right packet sequence delivery. RFC 793 13
Internet - UDP UDP transmission between coriolis and the server fibbla at Chalmers. 194.47.1.137 coriolis.hh.se 129.16.20.156 fibbla.ce.chalmers.se Listning for requests DATA request Data i retur DATA response Returns the requested data 14
Internet - TCP TCP transmission between the client coriolis and the webbserver fibbla at Chalmers. Open connection Data request Connection opened 194.47.1.137 coriolis.hh.se SYN j SYN j+1, ACK k ACK k+1 DATA request 129.16.20.156 fibbla.ce.chalmers.se Listning for requests Data i retur DATA response and ACK of the request ACK DATA response Close Connection Wait for delayed packets FIN m ACK m+1 FIN n ACK n+1 Passive closing Close connection Closed 15
Internet Domain Name Server (DNS) A distributed mapping system between host names and IP (for example fibbla.ce.chalmers.se =>???). DNS is implemented as hierarchical database. InterNIC coriolis fibbla.ce.chalmers.se 129.16.20.156 Lokal namn server Chalmers domain server 16
Internet - Application Protocol Application Application processes Presentation Application Session Transport TCP UDP sockets Network Datalink Physical OSI reference model IP Device Driver and Hardware Internet protocol model Operative system 17
Application Protocol File Transfer Protocol (FTP), rfc 959. Hyper Text Transfer Protocol (HTTP), rfc 1945 och rfc 2068. Simple Mail Transfer Protocol (SMTP), rfc 821. Network News Transport Protocol (NNTP), rfc 977. Internet Engineering Task Force (IETF) http://www.ietf.org/rfc.html 18
HTTP overall function Stateless protocol The client opens a TCP connection and sends a request to a server and the server answers with the requested data and than the connection is closed. Uniform Resource Locator (URL) Http://www.hh.se:80/index.html Protokoll Host namn Port nummer Fil namn Web browser coriolis.hh.se Network förfrågan svar Web server 19
HTTP Applikations Protokollet HTTP command (method). A number of methods; GET, HEAD, POST, PUT, OPTIONS, DELETE, TRACE. The most usual is GET (Client request). Method Request URI Protocol For example: GET /index.html HTTP/1.0 First comes a header that tells the configuration of the client. Keyword: Value For example: User-Agent: Mozilla/4.0 Accept: image/gif, image/jpeg, text, */* 20
HTTP Applikations Protokollet Server response. Protocol Status-code Description For example: HTTP/1.0 200 OK [CRLF] Then some header-information and requested data: Keyword: Value For example: Date: Wed, 1 Jan 2001 15:30:24 GMT [CRLF] Server: Apache/1.3.6 (Unix)[CRLF] Last-Modified: Mon, 17 May 1999 15:46:21 GMT [CRLF] Accept-Range: bytes [CRLF] Content-Length: 10352 [CRLF] Connection: Close [CRLF] Conntent-Type: text/html; char-set=iso-8859-1 [CRLF] [CRLF] 21
HTTP Application Protocol The body of the HTML document: <HTML> <HEAD> </HEAD> <BODY>.... </BODY> </HTML> 22