Layered Architecture and Network Protocols EE450 Introduction to Computer Networks Professor A Zahid EE450 USC Zahid 1 Protocols Human Protocols z what s the time z I have a question z Introductions Network Protocols z z specific msgs sent specific actions taken when msgs received or other events Machines rather than humans All communication activity in Internet governed by protocols Protocols define format order of msgs sent and received among network entities and actions taken on msg transmission receipt EE450 USC Zahid 2 Human vs Network Protocols TCP connection request Hi Hi Got the time TCP connection reply Get http www usc com grades html 2 00 time EE450 USC Zahid file 3 Key Elements of a Protocol z Syntax Data formats compression encryption etc z Signal levels z z Semantics Control information such as flow congestion z Error detection and control mechanisms z z Timing Speed matching z Sequencing z z Fairness EE450 USC Zahid 4 Standards z Required to allow for interoperability between equipment z Advantages z Disadvantages z Ensures a large market for equipment and software z Allows products from different vendors to communicate z Freeze technology EE450 USC Zahid 5 OSI Reference Model EE450 USC Zahid 6 Data Transfer in OSI EE450 USC Zahid 7 Layered Communications z z z Peer layers communicate via protocols Adjacent layers communicate via service interfaces Protocol control information PCI is added to Service data unit SDU at each layer to form a Protocol data unit PDU z SDU N PDU N 1 z PDU N SDU N PCI N EE450 USC Zahid 8 Why Layering Dealing with complex systems z explicit structure allows identification relationship of complex system s pieces z z layered reference model for discussion Modularization eases maintenance updating of system z z change of implementation of layer s service transparent to rest of system change in one layer doesn t affect rest of system EE450 USC Zahid 9 Summary of Layers Functionality EE450 USC Zahid 10 The Internet and TCP IP EE450 USC Zahid 11 Internet Protocol Stack z z z z z Application supporting network applications z FTP SMTP HTTP application transport Transport process process data transfer z TCP UDP network Network routing of datagrams from source to destination z IP routing protocols Link data transfer between neighboring network elements z PPP Ethernet Physical bits on the wire link physical Developed by the US Defence Advanced Research Project Agency DARPA for its packet switched network ARPANET EE450 USC Zahid 12 TCP IP Model EE450 USC Zahid 13 Message Transmission using TCP IP EE450 USC Zahid 14 TCP IP vs OSI Models EE450 USC Zahid 15 Encapsulation source message segment Ht Hn Ht packet frame Hl Hn Ht M M M M application transport network link physical Switch link physical switch destination M Ht Hn Ht Hl Hn Ht M M M application transport network link physical Hn Ht Hl Hn Ht M M network link physical Router Hn Ht M router EE450 USC Zahid 16 Communications between Networked Applications EE450 USC Zahid 17 Communications between Transport Layers EE450 USC Zahid 18 Network Layer Communications EE450 USC Zahid 19 Link Layer Communications EE450 USC Zahid 20 Addressing in TCP IP EE450 USC Zahid 21 TCP IP Layers and Addresses EE450 USC Zahid 22 Link Layer MAC Addresses Most local area networks use a 48 bit 6 Bytes physical address written as 12 hexadecimal digits with every 2 Bytes separated by a hyphen for example 07 01 02 01 2C 4B a node with MAC address 10 sends a frame to a node with MAC address 87 The two nodes are connected by a link At the data link level this frame contains MAC addresses in the header These are the only addresses needed The header contains other information needed this level The trailer contains extra bits needed for error detection EE450 USC Zahid 23 Internetwork Communications An Internet address in IPv4 is 32 bits in length written as four decimal numbers with each number representing 1 Byte The numbers are separated by a dot For example 128 125 75 9 A node with an IP address A and MAC address 10 located on one LAN to a node with an IP address P and MAC address 95 located on another LAN Because the two devices are located on different networks we cannot use MAC addresses only the MAC addresses only have local significance What we need here are universal addresses that can pass through the LAN boundaries The IP address has this characteristic EE450 USC Zahid 24 Port Addresses A port address is a 16 bit address represented by one decimal number for example 750 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 Data are split into two Packets each retaining the port addresses j and k Then in the network layer IP addresses A and P are added to each packet EE450 USC Zahid 25 Layered Architecture and Networks Each host needs a unique global address referred to as the IP address Each application on a multitasking computer needs a unique address referred to as the Port number within the computer EE450 USC Zahid 26 Overview of Network Programming Sockets EE450 Introduction to Computer Networks Professor A Zahid EE450 USC Zahid 27 Application Programming Interface z The services provided by the operating system that provide the interface between application and the TCP IP Protocol Suite Application Network API Protocol A Protocol B EE450 USC Zahid Protocol C 28 API Sockets z z z z z TCP IP does not include an API definition There are a variety of APIs for use with TCP IP z UNIX Sockets z Winsock Windows Sockets A socket is an abstract representation of a communication endpoint A socket allows the application to plug in to the network and communicate with other applications A socket is uniquely identified by the IP address Port number and the underlying transport layer protocol EE450 USC Zahid 29 Socket Types EE450 USC Zahid 30 Socket Structure EE450 USC Zahid 31 Socket Descriptor Data Structure Descriptor Table 0 1 2 3 Family PF INET Service SOCK STREAM Local IP 111 22 3 4 Remote IP 123 45 6 78 Local Port 2249 Remote Port 3726 4 EE450 USC Zahid 32 Basic Sockets API z z Clients and Servers differ in some aspects of their use of API and they are the same in other aspects Both client and server programs begin by asking the NOS to create a socket The function to accomplish that is Socket z z z z z int socket int protocol family int type int protocol Protocol family PF INET Type SOCK STREAM SOCK DGRAM Protocol TCP UDP Return
View Full Document