1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Copyrights @ 2013 by John Wiley & Sons, Inc Most chapter references are related to Behrouz A Forouzan ed4 Jozef Goetz, 2012 expanded by Jozef Goetz, 2012 2 Objectives Exam Objective Matrix Technology Skill Covered Exam Objective Exam Objective Number Introduction to the OSI Model Compare the layers of the OSI and TCP/IP models. OSI model: • Layer 1—Physical • Layer 2—Data Link • Layer 3—Network • Layer 4—Transport • Layer 5—Session • Layer 6—Presentation • Layer 7—Application Classify how applications, devices, and protocols relate to the OSI model layers. • IP address • Frames • Packets • Cable 1.1 Jozef Goetz, 2012 1.2 3 Objectives Exam Objective Matrix Technology Skill Covered Exam Objective Exam Objective Number TCP/IP Model Compare the layers of the OSI and TCP/IP models. TCP/IP model: • Network Interface Layer • Internet Layer • Transport Layer • Application Layer • (Also described as: Link Layer, Internet Layer, Transport Layer, Application Layer) 1.1 Jozef Goetz, 2012 2-1 LAYERED TASKS •We use the concept of layers in our daily life. •As an example, let us consider two friends who communicate through postal mail. •The process of sending a letter to a friend would be complex if there were no services available from the post office. Topics discussed in this section: Sender, Receiver, and Carrier Hierarchy Jozef Goetz, 2012 4 Sending a letter: 5 The concept of layers with the sender and receiver address Home layer Mailbox layer sorted and PO layer and sorted Note: each layer at the sending site uses the services of the layer immediately below it. There is a hierarchy (order) of different asks: •e.g. at the sender site. •The letter must be written and dropped in the mailbox before being picked up by the letter carrier and Jozef Goetz, 2012delivered to PO 6 Jozef Goetz, 2012 7 Jozef Goetz, 2012 8 Jozef Goetz, 2012 9 Jozef Goetz, 2012 2-2 THE OSI MODEL •Established in 1947, the International Standards Organization (ISO) is a multinational body dedicated to worldwide agreement on international standards. •An ISO standard that covers all aspects of network communications is the Open Systems Interconnection (OSI) model. •It was first introduced in the late 1970s. Topics discussed in this section: Layered Architecture Peer-to-Peer Processes Encapsulation Jozef Goetz, 2012 10 11 Note ISO is the organization. OSI is the model. Jozef Goetz, 2012 12 Figure 2.1 Seven layers of the OSI model Jozef Goetz, 2012 Mnemonics: Top to bottom All People Seem To Need Data Processing Bottom to top Please Do Not Throw Sausage Pizza Away 13 Figure 2.2 Jozef Goetz, 2012 Internet layers 14 Figure 2.3 Jozef Goetz, 2012 Peer-to-peer processes Protocol Hierarchies Layers: Networks are organized as a stack of levels or layers to reduce their design complexity. Each layer perform a specific collection of well–understood related functions We build each layer on the one below it. Each layer talks to the ones above & below it Each layer hides underlying details from the one above it – sort of a virtual machine, offering certain services (operations) to the layer above it Layers differ in number and function from one network to another. Jozef Goetz, 2012 15 interfaces and protocols Between each pair of adjacent layers is an interface. defines what information and services the lower layers makes available to the upper one. Well defined interfaces and layers provide modularity to a network Layers or their services (functions) are replaceable The corresponding layers on different machines are called peers The peers communicate by using protocols Jozef Goetz, 2012 16 Services to Protocols Relationship Services is a set primitives (operations) that the layer provides layer above it What functions does this layer provide? Services like an OOD - object oriented design to the abstract data type in A protocol is a set of rules governing the format and meaning of the packets and/or msgs that are exchange by the peers entities within a layer. 17 A protocol relates to the implementation of the service and as such Entities use protocols to implement their service definition is not visible to the user of the service The services and the protocols are completely decoupled Jozef Goetz, 2012 18 Figure 2.3 The interaction between layers in the OSI model A communications protocol is a system of digital message formats and rules for exchanging those messages in or between computing systems Jozef Goetz, 2012 Protocols Protocols: 1. 2. Jozef Goetz, 2012 Define data types for transmission Provide different services (a set of operations) Initiate a connection Transmit data Terminate a connection Are layered to form architectures 19 20 Jozef Goetz, 2012 21 Figure 2.4 An exchange using the OSI model Each layer in the sending device •adds its own info (header) to the msg it receives from the layer just above it and •passes the whole package to the layer below Header contains information that describes what each layer of the OSI Model should do with the data At the receiving device, the msg is unwrapped layer by layer (the msg moves back up throught the OSI layers): •i.e. the headers and trailers (T2) attached to it at the corresponding sending layer Jozef Goetz, 2012 are removed, and actions appropriate to that layer are taken Data as It Moves Through OSI Layers, Sent by One Computer and Received by Another Jozef Goetz, 2012 22 23 Figure 2.4 An exchange using the Internet model Encapsulation concept: level N – 1 is not aware which part of the packet is data and which part is the header •A packet at level 5 is encapsulated in packet at level 4. •Level 4 is not aware which part of the encapsulated packet is data and which part •is the header. •The packet in level 4 is encapsulated in packet at level 3, and so on. Jozef Goetz, 2012 Protocol encapsulation user X “Hello” user Y e-mail client “Hello” e-mail server TCP server “Hello” TCP server IP server “Hello” IP server “Hello” ethernet driver/card ethernet driver/card Jozef Goetz, 2012 24 Encapsulation/De-encapsulation The process of moving data between layers of the OSI Model Encapsulation: Data > segment > packet > frame > bits De-encapsulation: Bits > frame > packet > segment > data Jozef Goetz, 2012 25 How Data Is Referred to in the OSI Model Data Segment • Transport layer Packet • Networking layer Frame • Data Link layer Bits Jozef Goetz, 2012 • Application, Presentation, and Session layers • Physical layer 26 Physical Layer PL 1 Note: 1. The physical layer is responsible for transmitting individual bits from one node to the next. Jozef Goetz, 2012 27 Physical layer 28 •Defines physical means that are used to transmit data: •Cable standards – e.g. copper wiring •Wireless standards – e.g. radio frequencies •Fiber optic standards – e.g. light pulses •Concerned with the characteristics of the physical medium to transfer row bits over a communication channel. •Deals with •mechanical, •electrical, •functional, •procedural and •timing interfaces, and •the physical medium itself. Jozef Goetz, 2012 29 Physical layer duties 1. 2. 3. 4. 5. 6. Jozef Goetz, 2012 Physical characteristics of interfaces and media • Plug types, materials etc. Representation (encoding) of bits • E.g. TTL 5v = 1, 0 = 0v, RS232C 1 = -12v, 0 = +12v • Sensitivity of receivers, e.g. minimum voltage for 1 in RS232C is -3v Data Rate/Transmission Rate • How many bits per second Synchronization of bits • Not only the bit rate but when does a char or frame/packet starts and ends Transmission mode: simplex, half-duplex, or full-duplex Physical topology: mesh, star, bus, ring, or hybrid Data Link Layer DDL 2 Shows relationship of it to other layers Jozef Goetz, 2012 30 Figure 2.7 Node (hop)-to-node (hop) delivery by the DLL 31 The data link layer is responsible for transmitting frames from one node to the next (of the same network). Jozef Goetz, 2012 Data Link Layer DDL 2 - point-to-point connection Deals with transforming a raw line into a line that appears free of errors to the network layer. 32 It accomplishes with breaking up the data into data frames, transmit the frames sequentially, and then receiving acknowledgements back. This layer also deals with different hardware speeds by slowing some transmissions if the other end can’t keep up. How much buffer space the receiver has? Jozef Goetz, 2012 How the error is handled? Data link layer duties: •Framing • the data link layer DLL divides the stream of bits into manageable data units called frames • Physical Addressing • adds a header to the frame containing sender and/or receiver address • Flow Control • Controls how fast a transmitter can send to a receiver • Error Control • Detection and recovery from error conditions or lost frames •Achieved through a trailer T2 added to the end of the frame • (Medium) Access Control • who has control over the link at any given time •Fair access to shared data link networks e.g. Ethernet Jozef Goetz, 2012 33 Data Link Layer of OSI Model Can move frames from one adjacent computer to another, cannot move frames across routers Encapsulation = frame Requires a unique MAC address. or physical address e.g. 11-00-68-BF-F8-EA Protocols defined include Ethernet Protocol and Point-to-Point Protocol (PPP) Jozef Goetz, 2012 34 Data Link Layer of OSI Model Device example: Switch Two sublayers: Logical Link Control (LLC) and the Media Access Control (MAC) Jozef Goetz, 2012 35 LLC and MAC Sublayers Logical Link Control (LLC) Data Link layer addressing, flow control, address notification, error correction Media Access Control (MAC) Determines which computer has access to the network media at any given time Determines where one frame ends and the next one starts, called frame synchronization Jozef Goetz, 2012 36 37 Figure 2.19 Example 1 •In Figure below a node with physical address 10 sends a frame to a node with physical address 87. The two nodes are connected by a link. At the data link level this frame contains physical addresses in the header. •These are the only addresses needed. The rest of the header contains other information needed at this level. •The trailer usually contains extra bits needed for error detection Jozef Goetz, 2012 Network Layer NL 3 Shows relationship of it to other layers Jozef Goetz, 2012 38 39 Figure 2.9 Source-to-destination delivery across different networks The network layer is responsible for the delivery of packets from the original source to the final destination (across different network). Jozef Goetz, 2012 Network Layer 3 Controls the operation of the subnet. A key design issue is - determining how packets are routed. Packet routing may be 40 static (based on static tables ex. determined from a terminal session) or dynamic (determined for each packet), depending on the type of network. Other issues: Jozef Goetz, 2012 congestion control, quality of service: (delay, transit time etc.), overcome protocol differences Network Layer of OSI Model Responsible for moving packets (data) from one end of the network to the other, called end-to-end communications Device example: Router Jozef Goetz, 2012 Routing is the ability of various network devices and their related software to move data packets from source to destination 41 Network layer duties 42 1. Source to Destination Delivery • Beyond the same link • Interconnected basic different networks 2. Logical Addressing such as IP e.g. 192.45.0.120 • if packet passes the network boundary we need to distinguish the source and destination network by adding header with the logical sender and receiver addresses • so we separate from physical addressing at data link • logical addresses need to be assigned to every computer on a network • the logical addresses doesn’t change 3. Routing/Internetworking • determine how to get from the source to the destination • connecting devices (routers or switches ) are used to route to Jozef Goetz, 2012 43 Figure 2.20 Example 3 •In Figure we want to send data from a node with network address A and physical address 10, located on one LAN, to a node with a network address P and physical address 95, located on another LAN. •Because the two devices are located on different networks, we cannot use physical addresses only; •the physical addresses only have local jurisdiction. •What we need here are universal addresses that can pass through the LAN boundaries? •The network (logical) addresses have this characteristic. Jozef Goetz, 2012 Transport layer TL 4 44 Note: Network L. deliver individual packets, it doesn't recognize any relationship between packets which belonged to some segments. The transport layer is responsible for delivery of a segment (message) from one process to another. Jozef Goetz, 2012 Figure 2.11 Jozef Goetz, 2012 45 Reliable process-to-process delivery of a message Transport Layer of OSI Model 46 Takes data from higher levels of OSI Model and breaks it into segments that can be sent to lower-level layers for data transmission Conversely, reassembles data segments into data that higher-level protocols and applications can use Also puts segments in correct order (called sequencing ) so they can be reassembled in correct order at destination Jozef Goetz, 2012 Transport Layer TL 4 Serves as the interface between the Session and Network layers. The Transport Layer is responsible for 47 breaking up larger data (messages) from the session layer into (smaller messages) segments and then sending them across the network layer making sure the all pieces arrive correctly to the destination The transport layer is a true end-to-end layer, all the way from the source to the destination Jozef Goetz, 2012 A program on the source machine carries on a conversation with the similar program on the destination machine In the lower layers, the protocols are between each machine and its immediate neighbors, not between the ultimate source and destination. Transport layer duties 1. Port addressing • Process (running program) on one computer delivers a message (msg) to a specific process on the other. • To identify the process the port address is provided to the TL 2. Segmentation and reassembly control • Sending large amounts of data needs to be managed by breaking down into transmissible segments • Each segment contains a sequence # in order to reassemble data (message) at the destination Jozef Goetz, 2012 48 Transport layer duties 49 3. Connection control • a phone call like service (connection oriented service - such as TCP to ensure destination received segments) or • a postcard like service without verification (connectionless service - such as UDP to send segments without assurance of delivery ) – e.g. VoIP, video – data-streaming apps 4. Flow control • End to End control at a process level 5. Error control • End to End error control rather than a single link Jozef Goetz, 2012 50 Figure. Example 3. Internet Model Figure shows an example of transport layer communication. Data coming from the upper layers have port addresses j and k (j is the address of the sending process, and k is the address of the receiving process). •Since the data size is larger than the network layer can handle, the data (message) are split into two segments, each segment retaining the port addresses (j and k). Then in the network layer, network addresses (A and P) are added to each packet. Jozef Goetz, 2012 Session layer SL 5 The session layer is responsible for dialog control and synchronization. Jozef Goetz, 2012 51 Session Layer SL 5 52 Allows users on different machines to establish a session, manage and terminate session. Session services provide: dialog control (who transmits next) • provides communications between 2 Ps in simplex, half-duplex, or full-duplex synchronization (checkpointing long transactions so they can continue after a crash), adjournment, termination and restart or recovery • SL allows to add checkpoints, or synchronization points, to a stream data in order if a crash happens during the retransmission send one from the last checkpoint • e.g. 2000 pages are sent, but a crash happens at page 123, so pages are needed to resend are 101 to 125 token management (preventing the same critical operation at the same time). Jozef Goetz, 2012 Presentation Layer 6 Handles the syntax and semantics of the info exchanged between systems. The presentation layer is responsible for translation, compression, and encryption. Jozef Goetz, 2012 53 Presentation Layer PL 6 1. Manages translation Allows data to move from one machine to another while retaining the appropriate format. allows higher-level data structure (e.g., banking records), to be defined into a common format at the sender and send it to the receiver which converts into its receiverdependent format. Jozef Goetz, 2012 54 Presentation Layer PL 6 2. Encryption The sender transforms the orginal info to another form (to protect from interception or eavesdropping) and sends msg out over the network Decryption reverses to its orginal form at the receiver e.g. Secure Socket Layer (SSL) and IPSec (ure) 3. Compression Reduces the # of bits Jozef Goetz, 2012 Important for sending text, audio, and video 55 Application Layer 7 The application layer is responsible for providing network services (access to the network) to the user. Jozef Goetz, 2012 56 Application Layer Contains protocols that are often needed by users, such as HTTP. The application layer is the most abstract layer and is closest to the user. The user is most likely to interact with the application layer than any other layer in the model. Jozef Goetz, 2012 57 Application Layer 58 Provided services: network virtual terminal file transfer, access and mgmnt for e-mail forwarding and storage E-mail program may use POP3 (Post Office Protocol version 3) to read e-mails and SMTP (Simple Mail Transport Protocol) to send e-mails directory services access to a remote host to make changes and read data retrieve/send files from/to a remote host mail services to logon to a remote host database access for global info about services etc. Firefox web browser uses HTTP (Hyper-Text Transport Protocol) Jozef Goetz, 2012 59 Summary of layers ! Jozef Goetz, 2012 The OSI Reference Model This is the “International Standards Organization Open Systems Interconnection Reference Model”, or the ISO OSI Reference Model. We will call it the OSI model. There is a protocol defined for each layer by the ISO. 60 The protocols are rarely used anymore, but the model is very relevant. Jozef Goetz, 2012 Principles behind the model. 1. 2. 3. 4. 5. • Layers should be created where abstraction is needed. • Each layer should perform a well-defined function. • The function of the layer should be chosen while defining protocols. • The layer boundaries should be chosen to minimize the information flow across the interfaces. • There should not be too many or too few layers. Jozef Goetz, 2012 61 OSI The OSI itself is not a network architecture because it does not specify exact services and protocols to be used in each layer. It just tells what each layer should do However ISO produced standards for all the layers, although these are not part of the reference model itself Jozef Goetz, 2012 62 Reference Models. The OSI reference model. Jozef Goetz, 2012 63 64 2-4 TCP/IP PROTOCOL SUITE (Internet Model) •The layers in the TCP/IP protocol suite do not exactly match those in the OSI model. •The original TCP/IP protocol suite was defined as having four layers: host-to-network, internet, transport, and application. •However, when TCP/IP is compared to OSI, we can say that the TCP/IP protocol suite is made of five layers: physical, data link, network, transport, and application. Topics discussed in this section: Physical and Data Link Layers Network Layer Transport Layer Application Layer Jozef Goetz, 2012 The TCP/IP Reference Model – the model itself is not much use but the protocols are widely used This data communication model was first defined in 1974 when the internet was still part of ARPANET. Major Goals: 65 The Army-driven design was meant to allow the computer network to communicate even if a part of the network was down. This would allow the network to continue to work in the case of a war. The military was also worried about lost connections. They did not want a connection to die as long as the source and destination machines were alive, even if some of the machines in the middle were lost. This put further requirements on any protocol that might be created. Jozef Goetz, 2012 66 The TCP/IP reference model. The host-to-network layer is undefined in this model. They leave out all of the underlying layers, leaving the implementation up to whoever creates the network. The TCP/IP internet layer is similar in functionality to the OSI network layer. Jozef Goetz, 2012 67 Figure 2.16 TCP/IP and OSI model p.43-44 •The 5th layer deals with the Internet services provided by various applications. •The first 4 layers deal with the communication between hosts. •Layers 3 and 4 are fully implemented in the operating systems kernel on most existing systems. •The first 2 layers are network hardware specific, the others are work independently of the physical layer •Most of the 1st layer is handled by hardware (communication medium used, attachments of hosts to the medium). •The rest of the 1st layer and all the 2nd layer is handled by the (Network Interface Card) NIC card in a host. Jozef Goetz, 2012 68 Network Models with approximate mapping between the two •The 5th layer deals with the Internet services provided by various applications. •The first 4 layers deal with the communication between hosts. •Layers 3 and 4 are fully implemented in the operating systems kernel on most existing systems. •The first 2 layers are network hardware specific, the others are work independently of the physical layer •Most of the 1st layer is handled by hardware (communication medium used, attachments of hosts to the medium). •The rest of the 1st layer and all the 2nd layer is handled by the (Network Interface Card) NIC card in a host. Jozef Goetz, 2012 Internet Layer. The requirements resulted in a complex network led to choice of a packet-switching network based on a connectionless internetwork layer. The Internet (Network) Layer is responsible for injecting packets into any network and have them travel to their destination. Order of arrival is not important to the internet layer – they packets can be sorted out later by the higher layers. The internet layer defines an official packet format for and protocol called Internet Protocol (IP). the major issue is packet routing to avoid congestion. Jozef Goetz, 2012 69 Transport Layer. 70 The transport layer is intended to allow two machines to carry on a conversation, just like the OSI transport layer. There are two end-to-end protocols defined for this: – TCP (Transmission Control Protocol) reliable, byte stream connection-oriented for application without errors – file transfer – UDP (User Datagram Protocol) unreliable, connectionless Jozef Goetz, 2012 for applications that don’t need TCP’s sequence or flow control and wish to provide their own used for client/server request reply queries in which prompt delivery is more important than accurate delivery, such as a transmitting speech or video TCP/IP Model and its Relation to Protocols of the TCP/IP Suite The Application layer contains all of the higher-level protocols 71 Network Interface Layer has Link Layer synonym – FTP – file transfer TFTP - Trivial File Transfer Protocol - used for automated transfer of configuration or boot files between machines in a local environment – SMTP – e-mail – DNS - Domain Name System – NNTP - Network News Transfer Protocol – HTTP - Hypertext Transfer Protocol Jozef Goetz, 2012 The TCP/IP Protocol Suite IGMP - Internet Group Management Protocol handles multicasting ICMP - Internet Control Message Protocol Handles errors and control messages. Protocol is used to forward information, primarily error messages. To see if a computer is running, the `ping' program sends an echo request, which is part of ICMP. ARP -Address Resolution Protocol is a protocol for mapping an Internet Protocol IP address to a physical machine address that is recognized in the local network. For example, in IP Version 4, the most common level of IP in use today, an address is 32 bits long. In an Ethernet LAN, however, addresses for attached devices are 48 bits Jozef Goetz, 2012 RARP - Reverse Address Resolution Protocol is a protocol by which a physical machine in a LAN can request to learn its IP address from a gateway server's Address Resolution Protocol (ARP) table or cache. A network administrator creates a table in a LAN’s gateway router that maps the physical machine (addresses) into IP addresses. 72 Comparing OSI and TCP/IP Models Both are: based on the concepts of a stack of independent protocols the layers up through transport layers provide an end-to-end networkindependent transport service the layers above transport are application-oriented users Jozef Goetz, 2012 73 Comparing OSI and TCP/IP Models 74 • The differences between the TCP/IP (4 layers) and OSI (7 layers) models. • OSI model clearly defined the distinction between services, interfaces (specifies what the parameters are and what result to expect) and protocols, where the TCP/IP model does not. • Protocols can easily be replaced in the OSI model (as long as it provides the offered services), but not in the TCP/IP model. Jozef Goetz, 2012 This fits in nicely with OO programming concepts as the layer (an object) hide information and has a set of methods (services) that processes outside the object can invoke The code internal to the object is its protocol and it is not visible outside the object Abstraction hides details of one layer from others Comparing OSI and TCP/IP Models 75 • The OSI model has no biases for protocols, but the OSI model was overly general and did not help with the creation of new protocols. • OSI supports: connectionless and connection-oriented in the network layer, but only connection-oriented in the transport layer, providing no choice to the user. • TCP/IP supports: Jozef Goetz, 2012 only connectionless in the network layer, but both in the transport layer, giving user a choice (TCP, UDP). Comparing OSI and TCP/IP Models The OSI reference model was devised before the corresponding protocols were invented With TCP/IP the protocols came first, and the model was just a description of the existing protocols Jozef Goetz, 2012 So protocols fit perfectly 76 A Critique of the OSI Model and Protocols Why OSI did not take over the world Bad timing Bad technology 7 layers choice more political than technical, layer 5 and 6 nearly empty, 2 and 3 are overfull Functions: addressing, flow control, error control are in each layer instead error control must be done in the highest layer Bad implementations Competing TCP/IP was already there Initially because of the enormous complexity In contrast TCP/IP was part of Berkeley UNIX and free Bad politics Jozef Goetz, 2012 77 Bad Timing The apocalypse of the two elephants. Jozef Goetz, 2012 78 A Critique of the Models and Protocols • OSI 1. – Arrived late on the scene 2. – Model was too complex and the protocols were flawed 3. (some stuff appears in multiple levels) 4. – Poor implementation (no good example) 5. – Poorly marketed • TCP/IP 1. – model is just an explanation of what was already implemented 2. – model is not useful for describing any other protocol 3. – model does not clearly define layers 4. – model is not complete 5. – lead to the introduction of other poorly implemented protocols Jozef Goetz, 2012 79 A Critique of the TCP/IP Reference Model 1. Problems: Service, interface, and protocol not distinguished 2. 3. Not a general model Host-to-network “layer” not really a layer • • 4. in the normal sense of the term as used in the context of layered protocols It is an interface between layer 2 and 3 Doesn’t distinguish the physical and data link layers. 5. what is required by good software engineering practice to distinguish between the specification and the implementation These are completely different. They are not a separate layers. Minor protocols deeply firmly established (entrenched), hard to replace Jozef Goetz, 2012 80 A Critique of the Models and Protocols. In summary OSI – The model, minus the session and presentation layers, is exceptionally useful. TCP/IP – The protocol is in wide use and is accepted virtually everywhere. The Rest of the Course: • Focus on the useful layers of the OSI model while ignoring the ISO protocols. Jozef Goetz, 2012 81 2-5 ADDRESSING Four levels of addresses are used in an internet employing the TCP/IP protocols: physical, logical, port, and specific. Topics discussed in this section: Physical Addresses Logical Addresses Port Addresses Specific Addresses Jozef Goetz, 2012 82 83 Figure 2.17 Addresses in TCP/IP Jozef Goetz, 2012 84 Figure 2.18 Relationship of layers and addresses in TCP/IP e.g. URL Universal Resource Locator Jozef Goetz, 2012 85 Figure 2.19 Physical addresses •In Figure 2.19 a node with physical address 10 sends a frame to a node with physical address 87. •The two nodes are connected by a link (bus topology LAN). •As the figure shows, the computer with physical address 10 is the sender, and the computer with physical address 87 is the receiver. Jozef Goetz, 2012 86 Example 2.2 Most local-area networks use a 48-bit (6-byte) physical address (or MAC addresses) written as 12 hexadecimal digits; every byte (2 hexadecimal digits) is separated by a colon, as shown below: 07:01:02:01:2C:4B A 6-byte (12 hexadecimal digits) physical address. Jozef Goetz, 2012 Wide Area Networks 87 Relation between hosts on LANs and the subnet. The subnet consists of routers and transmission lines. Jozef Goetz, 2012 A router is a specialized piece of switching hardware that is responsible for determining the direction that data packets should be sent. Routers are responsible for directing data down transmission lines from one LAN to another. Wide Area Networks 88 A stream of packets from sender to receiver. A subnet is organized according to the principle called Storeand-forward or Packet-switched subnet – The message is broken down into smaller packets to send. – Each packet is sent out onto the network. – As a packet arrives at a router, it is stored there until the outgoing line is free. It is then sent on it’s way. – All the packets make take the same or different routes depending on if they are individually routed or not. Jozef Goetz, 2012 89 Figure: IP addresses •Figure shows a part of an internet with two routers connecting three LANs. •Each device (computer or router) has a pair of addresses (logical and physical) for each connection. •In this case, each computer is connected to only one link and therefore has only one pair of addresses. •Each router, however, is connected to 3 networks (only two are shown in the figure). •So each router has 3 pairs of addresses, one for each connection. Jozef Goetz, 2012 90 Figure 2.21 Port addresses •Figure 2.21 shows two computers communicating via the Internet. •The sending computer is running three processes at this time with port addresses a, b, and c. •The receiving computer is running two processes at this time with port addresses j and k. •Process a in the sending computer needs to communicate with process j in the receiving computer. •Note that although physical addresses change from hop to hop, logical and port addresses remain the same from the source to destination. Jozef Goetz, 2012 91 Example 2.5 As we will see in Chapter 23, a port address is a 16-bit (2 byte) address represented by one decimal number as shown. 753 A 16-bit port address represented as one single number. Jozef Goetz, 2012 92 Note The physical addresses change from hop to hop, but the logical and port addresses usually remain the same. Jozef Goetz, 2012 Summary: Difference between UDP and TCP internet protocol (IP) traffic 93 http://www.cyberciti.biz/faq/key-differences-between-tcp-and-udp-protocols/ Transmission Control Protocol (TCP) and User Datagram Protocol (UDP) is a transportation protocol that is one of the core protocols of the Internet protocol suite. Both TCP and UDP work at transport layer TCP/IP model and both have very different usage. Difference between TCP and UDP TCP: Reliability: TCP is connection-oriented protocol. When a file or message send it will get delivered unless connections fails. If connection lost, the server will request the lost part. There is no corruption while transferring a message. UDP: Reliability: UDP is connectionless protocol. When you a send a data or message, you don't know if it'll get there, it could get lost on the way. There may be corruption while transferring a message. TCP: Ordered: If you send two messages along a connection, one after the other, you know the first message will get there first. You don't have to worry about data arriving in the wrong order. UDP: Ordered: If you send two messages out, you don't know what order they'll arrive in i.e. no ordered Jozef Goetz, 2012 Summary: Difference between UDP and TCP internet protocol (IP) traffic 94 TCP: Heavyweight: - when the low level parts of the TCP "stream" arrive in the wrong order, resend requests have to be sent, and all the out of sequence parts have to be put back together, so requires a bit of work to piece together. UDP: Lightweight: No ordering of messages, no tracking connections, etc. It's just fire and forget! This means it's a lot quicker, and the network card / OS have to do very little work to translate the data back from the packets. TCP: Streaming: Data is read as a "stream," with nothing distinguishing where one packet ends and another begins. There may be multiple packets per read call. UDP: Datagrams: Packets are sent individually and are guaranteed to be whole if they arrive. One packet per one read call. TCP: Examples: World Wide Web (Apache TCP port 80), e-mail (SMTP TCP port 25 Postfix MTA), File Transfer Protocol (FTP port 21) and Secure Shell (OpenSSH port 22) etc. UDP: Examples: Domain Name System (DNS UDP port 53), streaming media applications such as IPTV or movies, Voice over IP (VoIP), Trivial File Transfer Protocol (TFTP) and online multiplayer games etc Jozef Goetz, 2012 Summary The physical layer is responsible for transmitting a bit stream over a physical medium. It is concerned with a. physical characteristics of the media b. representation of bits c. type of encoding d. synchronization of bits e. transmission rate and mode f. the way devices are connected with each other and to the links The data link layer is responsible for a. framing data bits b. providing the physical addresses of the sender/receiver c. data rate control d. detection and correction of damaged and lost frames The network layer is concerned with delivery of a packet across multiple networks; therefore its responsibilities include a. providing host-to-host addressing b. Routing The transport layer oversees the process-to-process delivery of the entire data (message). It is responsible for a. dividing the message into manageable segments b. reassembling it at the destination, c. flow and error control The application layer services include, file transfer, remote access, shared database management, and mail services Jozef Goetz, 2012 95 Summary Addresses The physical address is the local address of a node; it is used by the data link layer to deliver data from one node to another within the same network. The logical address defines the sender and receiver at the network layer and is used to deliver messages across multiple networks. The port address (service-point) identifies the application process on the station. The application layer services include file transfer, remote access, shared database management, and mail services The application, presentation, and session layers of the OSI model are represented by the application layer in the Internet model. Jozef Goetz, 2012 The lowest four layers of OSI correspond to the Internet model layers. 96 Physical Mail CEO X “Lunch?” 97 CEO Y Secretary X “Lunch?” Secretary Y Mail Room X “Lunch?” Mail Room Y Postman X “Lunch?” Postman Y Post office X “Lunch?” Post office Y Jozef Goetz, 2012 Protocol stack: packet forwarding Host A 98 Host B Router R Router W HTTP HTTP TCP TCP IP ethernet Jozef Goetz, 2012 IP ethernet link IP link ethernet IP ethernet OSI units Address Layer Data Unit Delivery 7 ApplicationLayer 6 PresentationLayer 5 SessionLayer port #'s 4 TransportLayer log.address IP 3 NetworkLayer MAC phAddress 2 DataLinkLayer 1 PhysicalLayer Data (Messages) Data (Messages) Data (Messages) TCP Segments, UDP diagrams Process To Process //End to End Packet/Datagram Source Host to Destination Host Frames Point to Point //Hop to Hop <=The TCP/IP model reference to be used in our lectures Jozef Goetz, 2012 99