860 likes | 1.08k Vues
Message Standards (Protocols). Standards Govern the Exchange of Messages. Standards Rules of operation that allow two hardware or software processes to work together Even if they are from different vendors Standards Govern the Exchange of Messages Messages must be governed by strict rules
E N D
Standards Govern the Exchange of Messages • Standards • Rules of operation that allow two hardware or software processes to work together • Even if they are from different vendors • Standards Govern the Exchange of Messages • Messages must be governed by strict rules • Because computers are not intelligent Message
Standards Govern Syntax • Syntax: the organization of the message • Human example: “Susan thanked Tom” • This sentence has a subject-verb-object syntax • Standards Govern Semantics • Semantics: The meaning of the message • Human example: “Susan thanked Tom” • Humans understand the meaning of this easily
Hypertext Transfer Protocol (HTTP) Interactions 1. HTTP Request Message Asking for a File Browser Webserver Application Webserver Client PC 2. HTTP Response Message delivering the File orgiving an error message Semantics in HTTP, which governs the Web
Syntax of HTTP Request and Response Messages • [CRLF] • Carriage return and line feed (starts a new line) • HTTP Request Message • GET /reports/project1/final.htm HTTP/1.1[CRLF] • GET is the method (others exist) • Next comes the path to the file to be retrieved • Last comes the version of the HTTP standard • Host: voyager.cba.Hawaii.edu[CRLF] • The host to be sent the request message
Syntax of HTTP Request and Response Messages, Continued • HTTP Response Message • HTTP/1.1 200 OK[CRLF] • Date: Tuesday, 20-JAN-2006 18:32:15 GMT[CRLF] • Server: name of server software[CRLF] • MIME-version: 1.0[CRLF] • Content-type: text/plain[CRLF] • [CRLF] • File to be downloaded (byte stream) • Syntax of fields (lines) after first line: • Keyword : Content [CRLF]
Services • Connection-Oriented • Connectionless
Connection-Oriented Services • Modeled after the telephone system • The service user first establishes a connection, uses the connection, and then releases the connection.
Connectionless Services • Modeled after the postal system • Each message carries the full destination address, and each one is routed through the system independent of all the others.
Service Primitives • Listen • Block waiting for an incoming connection • Connect • Establish a connection with a waiting peer • Receive • Block waiting for an incoming message • Send • Send a message to the peer • Disconnect • Terminate a connection
Connection-oriented network Client Server 1. Connect request 2. ACK 3. Request for data 4. Reply 5. Disconnect 6. Disconnect
Protocol Definition: A set of rules for communicating between computers. It specifies: Timing Format Sequencing Error control
Protocol Hierarchy • To reduce the complexity of a network, networks are organized as a stack of layers or levels. • Consider this as a form of • Information hiding • Abstract data types • Data Encapsulation
OSI Reference Model OSI – Open Systems Interconnection ISO – International Standards Organization
OSI Reference Model Application Protocol 7 Application Application Presentation Protocol 6 Presentation Presentation Session Protocol 5 Session Session Transport Protocol Transport Transport 4 Network layer Protocol 3 Network Network Data link layer Protocol 2 Data Link Data Link Physical layer Protocol 1 Physical Physical Router
Data Transmission in the OSI model Data Application Layer Application Layer AH Data Presentation Layer Presentation Layer PH AH Data Session Layer Session Layer SH PH AH Data Transportation Layer Transportation Layer TH SH PH AH Data Network Layer Network Layer NH TH SH PH AH Data Data Link Layer Data Link Layer DH NH TH SH PH AH Data Physical Layer Physical Layer Bits
TCP/IP OSI Application 7 Application 6 Presentation 5 Session Transport Transport 4 Internet 3 Network Host to Network Link 2 Data Link 1 Physical
Internet Layer • Corresponds to OSI Network Layer • Holds the whole architecture together • Permits hosts to inject packets into any network and have them travel to the designation • Defines an official packet format and protocol, IP (Internet Protocol) • Deliver IP packets to the destination • Packet routing is the major issue
Transport Layer • Corresponds to the OSI transport layer • Designed to allow peer entities on the source and destination hosts to carry on a conversation • Two end-to-end transport protocols • TCP (Transfer Control Protocol) • UDP (User Datagram Protocol)
TCP/IP OSI Application 7 Application 6 Presentation 5 Session Transport Transport 4 Internet 3 Network Host to Network Link 2 Data Link 1 Physical
TCP • Reliable Connection-oriented protocol • Transfer data from one machine to the other without error • Sends data in packets. The destination TCP then reassembles the packets to make sense • Flow control (synchronizes the speed)
UDP (User Datagram Protocol) • Unreliable connectionless protocol • No need for sequencing the packets • Good for one-shot client-server-type request-reply queries • Prompt delivery is more important than accurate delivery • E.g.) speech, video
Protocols and Networks in TCP/IP telnet FTP SMTP DNS Application TCP UDP Transport Protocols IP Network Internet Ethernet Token Ring Networks Physical + Data Link
Application Layer • No session or presentation layer • Application layer includes • Telnet • FTP (File Transfer Protocol) • SMTP (Simple Mail Transfer Protocol) • HTTP (HyperText Transfer Protocol) • NNTP (Network News Transfer Protocol) • POP3 (Post Office Protocol-3) • …..
Host-to-Network Layer • Corresponds to Data Link + Physical layer of OSI model
OSI Model vs. TCP/IP Model Both are based on the concept of a stack of independent protocols. The functionality of the layer is roughly similar. In both models, the layers up through and including the transport layer are there to provide an end-to-end network-independent transport service. The layers above transport are application-oriented.
OSI Model vs. TCP/IP Model • OSI model clearly distinguishes • Services ... tells what the layer does, not how entities above it access it or how the layer works • Interfaces ... tells the processes above it how to access it. It specifies what the parameters are and what results to expect. It does not say how the layer works inside. • Protocols ... it can use any protocols it wants to as long as it gets the job done. Software is transparent • TCP/IP model does not clearly distinguish between service, interface, and protocol.
OSI Model vs. TCP/IP Model • The protocols in the OSI model are better hidden than in the TCP/IP model and can be replaced relatively easily. • OSI model was devised before the protocols were invented. • protocol-independent • no experience protocols did not fit well.
OSI Model vs. TCP/IP Model • With TCP/IP, the reverse was true. • Protocol fit nicely • Difficult to describe non-TCP/IP networks. • OSI model supports both connectionless and connection-oriented communication in the network layer, but only connection-oriented communication in the transport layer. • TCP/IP model has only one mode in the network layer (connectionless) but supports both modes in the transport layer, giving the users a choice.
A Critique of the OSI Model and Protocols • Why OSI did not take over the world • Bad timing • Bad technology • Bad implementations • Bad politics
Bad Timing • The apocalypse of the two elephants.
A Critique of the TCP/IP Reference Model • Service, interface, and protocol not distinguished • Not a general model • Host-to-network “layer” not really a layer • No mention of physical and data link layers • Minor protocols deeply entrenched, hard to replace
Standards Govern the Exchange of Messages, Continued • General Message Syntax (Organization) • General Message Organization • Primary parts of messages • Data Field (content to be delivered) • Header (everything before the data field) • Trailer (everything after the data field) • The header and trailer act like a delivery envelope for the data field. Trailer Data Field Header
Standards Govern the Exchange of Messages, Continued • General Message Syntax (Organization) • Header and trailer are further divided into fields Trailer Data Field Header Other Header Field Destination Address Field is Used by Switches and Routers Like the Address on an Envelope Message with all three parts
General Message Organization, Continued Data Field Header Other Header Field Destination Address Field Message without a trailer Usually only data link layer messages have trailers
General Message Organization, Continued Header Other Header Field Destination Address Field Message with only a header e.g. TCP supervisory messages are pure headers (there is no data field content to deliver)
Reliable Transmission Control Protocol (TCP) Session • The Transmission Control Protocol (TCP) is an important standard in Internet transmission • TCP • Receiver acknowledges each correctly-received TCP segment. • If an acknowledgments is not received by the sender, the sender retransmits the TCP message (called a TCP segment) • This gives reliability: error detection and error correction
Reliable TCP Session, Continued Client PC TCP Process Webserver TCP Process 4. Data = HTTP Request 5. ACK (4) Carry HTTP Req & Resp (4) 6. Data = HTTP Response TCP Segment (Message) 4Carries an HTTP Request Segment 5 Acknowledges It There Is No Need to Resend 7. ACK (6) Request-Response Cycle for Data Transfer
A TCP Session, Continued Client PC TCP Process Webserver TCP Process 8. Data = HTTP Request (Error) 9. Data = HTTP Request (No ACK so Retransmit) Carry HTTP Req & Resp (4) TCP Segment (Message) 8Is Lost in Transmission There Is No Acknowledgment So the Sender Retransmits It 10. ACK (9) 11. Data = HTTP Response 12. ACK (11) Error Handling
Physical and Data Link Layer Standards • Govern Communication Through a Single Network • LAN or WAN
Physical Layer • Physical layer standards govern transmission between adjacent devices connected by a transmission medium Physical Link A-X1 Switch X1 Host A Switch X2 Physical Link X1-X2
Data Link Layer • Data link layer standards govern the transmission of frames across a single network—typically by sending them through several switches along the data link Frame Data Link A-B Host B Switch X1 Host A Switch X2
Data Link Layer • Data link layer standards also govern • Frame organization • Switch operation
3 Physical Links 1 Data Link 2 Switches Host A Switch Data Link A-R1 Switch Physical Link A-X1 Server Station Switch X1 Physical Link X1-X2 Physical Link X2-R1 Switch X2 Mobile Client Station Router R1
Internet and Transport Layers • An internet is a group of networks connected by routers so that any application on any host on any network can communicate with any application on any other host on any other network • Internet and transport layer standards govern communication across an internet composed of two or more single networks
Internet Layer • Internet layer standards govern the transmission of packets across an internet—typically by sending them through several routers along the route • Messages at the internet layer are called packets • Internet layer standards also govern packet organization and router operation Packet Router 1 Router 2
Host A Data Link A-R1 R1 Network X Network Y 3 Data Links: One per Network 1 Route per Internet Data Link R1-R2 Route A-B Network Z R2 Host B Data Link R3-B
Frame X Packet Data Link A-R1 Switch Host A Switch Server Station In Network X: Two Destination Addresses: Packet: Host B (Destination Host) Frame: Router R1 Switch X1 Mobile Client Station Switch X2 Route A-B Router R1 Network X
To Network X Route A-B Router R1 In Network Y: Two Destination Addresses: Packet: Host B (Destination Host) Frame: Router R2 Frame Y Data Link R1-R2 Packet Router R2 Network Y To Network Z