Download presentation
Presentation is loading. Please wait.
1
Lecture 3 Dr. Richard Spillman Fall 2012
NETWORKS Lecture 3 Dr. Richard Spillman Fall 2012
2
OUTLINE Application Transport Layer
3
Application
4
Email Systems Connects users through e-mail servers Mail Message
Sender’s PC Mail Server Receiver’s PC Message
5
Mail Servers Act like a postal service Deliver mail to one another
Report delivery failures -- hawaii.edu is the mail host Hold incoming mail until user logs in Mail servers also called: MTA Mail Transfer Agent
6
Sending Outgoing Mail Simple Mail Transfer Protocol (SMTP) SMTP SMTP
TCP/IP host-host mail standard (RFC 821) SMTP servers listen on port 25 Simple but effective, and widely used: For PC to send to mail host For one mail host to send to another SMTP SMTP
7
Mail Downloading Standards
POP (RFC 1081) Post Office Protocol Downloading mail only Widely implemented IMAP (RFC 1203) Internet Message Access Protocol Newer standard Do mailbox management tasks beyond downloading Can leave mail on the server and manage it there
8
ftp FTP server stores files Client logs into FTP server
Client program sends command to get a file FTP server sends the file with error correction FTP Server 1. Login 2. FTP “get” Command 3. Download
9
telnet Traditional Terminal-Host communication
Log into host computer (server) You can run programs there, such as clients Processing is done on the server Uses Internet to connect to host (server) can access host from anywhere on the Internet Telnet software on client PC Manages login, use, and disconnections
10
Summary The application layer adds a header that provides the necessary information to run the application across the network Physical Link Network Transport Application http, ftp, smtp, telnet, . . .
11
Transport Layer The Transport Layer Gives Platform Independence and Reliability Two computers do not have to be of the same platform type A PC user does not even know what kind of computer the webserver is
12
Transport Functions Transport Layer can provide:
vendor independence (uniform network interface) endpoint addressing (ports) reliability flow control connections fragmentation and reassembly But it is not involved in routing – determining where the two computers are actually located
13
Function Details 1 Synchronization and acknowledgement.
Initially, when the transmitter makes contact with the receiver it makes a unique connection. The transmitter thus knows that the receiver is on-line, and willing to receive data. Acknowledgements and retransmissions. This allows the receiver to send back acknowledgements which tell the transmitter that the data segments have been received correctly. If no acknowledgements have been received, the transmitter can either resend the data, or can assume that the receiver has crashed and that the connection is to be terminated. Flow control. This allows the receiver to tell the transmitter that it cannot receive any more data at present. This typically happens when the receiver has filled-up its receiving buffer.
14
Function Details 2 Windowing.
This is where the transmitter and the receiver agree on a window size when the connection is initially made. The window then defines the number of data segments that can be sent before the transmitter must wait for an acknowledgement from the receiver. Multiple connections onto a single data stream. The transport layer takes data from one or more applications; it then marks them with a unique connection number and segment number. At the receiver these can be demultiplexed to the correct application program. Reordering of data segments. All the data segments that are transmitted are marked with a sequence number. Thus if any are delivered in the incorrect order, or if any of them are missing, the receiver can easily reorder them or discard segments if one or more are missing.
15
Transport Layer Protocols
The functions of the Transport Layer are implement by one of two common protocols TCP – Transmission Control Protocol UDP – User Datagram Protocol Each adds a different type of header to the data + application package header
16
TCP Operation When a host wishes to make a connection, TCP sends out a request message to the destination machine that contains unique numbers called a socket number, and a port number. The port number has a value which is associated with the application (for example a TELNET connection has the port number 23 and an FTP connection has the port number 21). The message is then passed to the IP layer, which assembles a datagram for transmission to the destination. When the destination host receives the connection request, it returns a message containing its own unique socket number and a port number. The socket number and port number thus identify the virtual connection between the two hosts. After the connection has been made the data can flow between the two hosts (called a data stream). Sending Port Number Receiving Port Number Data Transfer between Ports
17
TCP Reliability Networks are typically unreliable
routers may discard packets if they are overworked (congested) packets may arrive at the destination out of order, if they travel via different routes through the Internet physical transmission medium may corrupt data (e.g. electromagnetic interference) The TCP protocol provides for error correction and detection in order to deal with: lost packets packets delivered out of order duplicate packets corrupted packets
18
Lost Packets When a host receives a packet, it replies with the acknowledgement number set to the value of the next sequence number it expects to see Timeout and retransmission assume a host has sent a packet of data, and is waiting for an acknowledgement from its peer that has a matching (or greater) sequence number if that acknowledgement does not arrive within a timeout period, the host will retransmit the packet If the packet was not lost, just delayed, then there will be two copies of it delivered No problem, because remote end discards duplicates!
19
Corrupted Packets The TCP protocol uses a checksum to verify data integrity A checksum is similar to a hash value The checksum value is calculated and attached to the data packet before it is sent At the receiving end, the checksum value is calculated and compared to the value that was sent If they do not match then the packet is not acknowledged After the time out period, the packet is sent again
20
Acknowledgement Number Options (variable length)
TCP Header The TCP protocol adds a header to the data + application header package TCP app data 32 bits Source Port # Destination Port # Sequence Number Acknowledgement Number Head Length Reserved U A P R S F Receiver Window Size CheckSum Urgent Data Pointer Options (variable length)
21
End Point Addressing Every computer has a unique address
on the Internet this is the computer’s IP address But, a single computer can run many applications e.g. a server in an organization may run a: web server mail server USENET news server more ... We need to have an address not only for each computer, but for each network application running on that computer each application is addressed by port number Both clients and servers use ports clients open new ports when creating a connection servers listen on ports, for incoming connections
22
What is a Port? Port Numbers
Provides unique address for each service on a host i.e. port# = transport layer address Range from Services run on “well-known” or “privileged” ports Clients connect from non-privileged or dynamic ports Internet Assigned Numbers Authority (IANA) tracks port assignments Source Port # Destination Port # TCP Header
23
Server Ports Applications monitor input activity looking for their port number Server TELNET server listens for port 23 Input TCP packets with port number FTP server listens for port 21 HTTP server listens for port 80 SMTP server listens for port 161
24
Common TCP Ports Port Service Comment Port Service Comment
1 TCPmux 7 echo 9 discard Null 11 systat Users 13 daytime 15 netstat 17 qotd Quote 18 msp Message send protocol 19 chargen ttytst source 21 ftp 23 telnet 25 smtp Mail 37 time Timserver 39 rlp Resource location 42 nameserver IEN whois Nicname 53 domain DNS 57 mtp Deprecated 67 bootps BOOTP server 67 bootps 68 bootpc BOOTP client 69 tftp 70 gopher Internet Gopher 77 rje Netrjs 79 finger 80 www WWW HTTP 87 link Ttylink 88 kerberos Kerberos v5 95 supdup hostnames 102 iso-tsap ISODE 105 csnet-ns CSO name server 107 rtelnet Remote Telnet 109 pop2 POP version 2 110 pop3 POP version sunrpc 113 auth Rap ID 115 sftp 117 uucp-path nntp USENET 123 ntp Network Timel 137 netbios-ns NETBIOS Name Service 138 netbios-dgm NETBIOS 139 netbios-ssn NETBIOS session 143 imap snmp SNMP 162 snmp-trap SNMP trap 163 cmip-man ISO management over IP 178 nextstep NeXTStep bgp BGP 191 prospero irc Internet Relay Chat 199 smux SNMP Multiplexer 201 at-rtmp AppleTalk routing
25
Socket = IP address + port number
Sockets Socket = IP address + port number :80 Client and server each need to open a socket. The server opens a socket and begins listening. The client opens a socket and sends to the server’s open socket.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.