Self-introduction 李全龙 口 Associate Professor Network Application Development o office: Room 504 of New Autumn 2005 00451-86413750(0) 00451-86922927(H) 13351781125 liquanlongehit, edu.cn lqlepublic. hr. hl.cn R eference Assessment ouglas E. Comer. David L Stevens, Internetw orking with TCP/IP, Course work-10% kets version(影印版),清华大学出版社,2002年1月.( Text book) Lab-20% 大学出版社2002年1月 ng Fegan. TCP/IP Protocol Suite Assignment (Mini Project)-20% 影印版),譫华大学出殿社2004年1月 Final examinition-50% pproach Featuring the Internet( hird Edition)影印脱), good t ligher Education Press(China)& Pearson Education, 2001 w. Richard Stevens. TCP/ P Illustrated Volume1,23,(影印版),机 被业出社,2003年月 Course schedule Relationship with other Courses(1) s Introduction App. Dev Practice Client sof tware design Server software design Raw socket programming Web-based network application development RPC/Middleware application development
1 哈工大计算机学院 李全龙 Network Application Development 1 Network Application Development Autumn, 2005 哈工大计算机学院 李全龙 Network Application Development 1: Introduction 2 Self-introduction 李全龙: Associate Professor Office: Room 504 of New Tech. Building Tel.: 0451-86413750(O.) 0451- 86922927 (H.) 13351781125 Email: liquanlong@hit.edu.cn lql@public.hr.hl.cn 哈工大计算机学院 李全龙 Network Application Development 1: Introduction 3 Reference Douglas E. Comer, David L. Stevens, Internetworking with TCP/IP, Vol. III, Client-Server Programing and Application, Windows Sockets Version(影印版),清华大学出版社,2002年1月.(Text Book) Douglas E. Comer, David L. Stevens, Internetworking with TCP/IP, Vol.I, II, (影印版),清华大学出版社,2002年1月。 Behrouz A. Forouzan & Sophia Chung Fegan, TCP/IP Protocol Suite (影印版), 清华大学出版社,2004年1月。 James F. Kurose and Keith W. Ross,Computer Networking-A TopDown Approach Featuring the Internet (Third Edition)(影印版), Higher Education Press (China) & Pearson Education, 2001. William Stallings, Data & Computer Communications (Sixth Edition), Higher Education Press (China) & Pearson Education, 2001. W. Richard Stevens, TCP/IP Illustrated Volume 1,2,3, (影印版),机 械工业出版社,2003年2月。 哈工大计算机学院 李全龙 Network Application Development 1: Introduction 4 Assessment Course work- 10% Lab- 20% Assignment (Mini Project)-20% Final examinition-50% 哈工大计算机学院 李全龙 Network Application Development 1: Introduction 5 Course schedule Introduction Socket API Client software design Server software design Raw socket programming Web-based network application development RPC/Middleware application development P2P application development 哈工大计算机学院 李全龙 Network Application Development 1: Introduction 6 Relationship with other Courses(1) Physical Data Link Network Transport Session Presentation Application Concepts&Theory Typical Net&Protocols App. Dev & Practice Computer Networks Net Planning & Imp Net App Dev
Relationship with oTher courses( Relationship with other Courses(2) pp Dev Practic Chapter 1: Introduction Chapter 1: Introduction Chapter goal: Network basics Network basics TCP/IP protocols stack TCP/IP protocols stack review review Client-server application Client-server application model and software design model and software design a Concurrent processing in a Concurrent processing in client-server model client-server model What's the Internet:"nuts and What's the Internet:"nuts and bolts" view bolts"view millions of connected workstation otocols: control sending receiving of msgs e/s e.g.,tcp, Ip, Http. Ftp mobile 國 Internet:"network of networks" loosely hierarchical satellite RFC: Request for comments routers: forward packets IETF: Internet Engineeri (chunks)of data thru Task Force company network
2 哈工大计算机学院 李全龙 Network Application Development 1: Introduction 7 Relationship with other Courses(2) Physical Data Link Network Transport Session Presentation Application Computer Net Net App Dev Net Planning &Implementation 哈工大计算机学院 李全龙 Network Application Development 1: Introduction 8 Relationship with other Courses(2) Concept&Theory Typical Net&Prot App Dev & Practice Computer Net Net App Dev Net Planning &Implementation 哈工大计算机学院 李全龙 Network Application Development 1: Introduction 9 Chapter 1: Introduction Chapter goal: Network basics TCP/IP protocols stack review Client-server application model and software design Concurrent processing in client-server model 哈工大计算机学院 李全龙 Network Application Development 1: Introduction 10 Chapter 1: Introduction Chapter goal: Network basics TCP/IP protocols stack review Client-server application model and software design Concurrent processing in client-server model 哈工大计算机学院 李全龙 Network Application Development 1: Introduction 11 What’s the Internet: “nuts and bolts” view millions of connected computing devices: hosts, end-systems pc’s workstations, servers PDA’s phones, toasters running network apps communication links fiber, copper, radio, satellite routers: forward packets (chunks) of data thru network local ISP company network regional ISP router workstation server mobile 哈工大计算机学院 李全龙 Network Application Development 1: Introduction 12 What’s the Internet: “nuts and bolts” view protocols: control sending, receiving of msgs e.g., TCP, IP, HTTP, FTP, PPP Internet: “network of networks” loosely hierarchical Internet standards RFC: Request for comments IETF: Internet Engineering Task Force local ISP company network regional ISP router workstation server mobile
What's a protocol? Key elements of a protocol u Used for communications between entities in a system Data formats Must speak the same language a Entities Signal level otocols define format, order a Semantics e-mail facilitie f mmsgs sent and received Control information among network entities, and actions taken on msg Error handling transmmission, receipt Timing Terminal Speed matching Remote senso Sequencing Protocol Functions The OSI Mode Encapsulation ms Interconnection(osr)model is defined by Segmentation and reassembly ernational Standard Organization (ISO)in 1984 a To open communication between different systems without changing the underlying architecture (software and hardware) Ordered delivery O An international standard that referenced by most network Error control a Best tools for teaching people about sending and receiving data a network. Multiplexing a Transmission services particular network function, This separation networking functions is called layering. Data flow and Peer communication in sI ay 7 layers of OSI model Advantages of multi-layered Layer 6: Presentation a Reduce complexity-simplified o Standardize interface ion6 Laver 4 o Allow communication between different network hardware 15 Layer 3 Layer 2: Data lin D A layer provide service for the layer above it
3 哈工大计算机学院 李全龙 Network Application Development 1: Introduction 13 What’s a protocol? Used for communications between entities in a system Must speak the same language Entities User applications e-mail facilities terminals Systems Computer Terminal Remote sensor protocols define format, order of msgs sent and received among network entities, and actions taken on msg transmission, receipt 哈工大计算机学院 李全龙 Network Application Development 1: Introduction 14 Key Elements of a Protocol Syntax Data formats Signal levels Semantics Control information Error handling Timing Speed matching Sequencing 哈工大计算机学院 李全龙 Network Application Development 1: Introduction 15 Protocol Functions Encapsulation Segmentation and reassembly Connection control Ordered delivery Flow control Error control Addressing Multiplexing Transmission services 哈工大计算机学院 李全龙 Network Application Development 1: Introduction 16 The OSI Model The Open Systems Interconnection (OSI) model is defined by International Standard Organization (ISO) in 1984. To open communication between different systems without changing the underlying architecture (software and hardware). An international standard that referenced by most network vendors for their products and services Best tools for teaching people about sending and receiving data on a network. Consist of seven layers: Physical (layer 1), data link (layer 2), Network (layer 3), Transport (layer 4), Session (layer 5), Presentation (layer 6) and Application (layer 7). Each of the layer illustrates a particular network function. This separation of networking functions is called layering. 哈工大计算机学院 李全龙 Network Application Development 1: Introduction 17 7 layers of OSI model Application Presentation Session Transport Network Data link Physical Layer 7: Layer 6: Layer 5: Layer 4: Layer 3: Layer 2: Layer 1: Advantages of multi-layered model Reduce complexity - simplified teaching and learning Standardize interface Allow communication between different network hardware and software Prevent the change of one layer from affecting the other layers Accelerate Evolution Some Characteristics for the 7-layer model Peer-to-peer process - layer N of one computer (device) can communicate with layer N on another computer (device) through protocols of that layer. A layer provide service for the layer above it 哈工大计算机学院 李全龙 Network Application Development 1: Introduction 18 Data flow and Peer communication in OSI layers Application Presentation Session Transport Network Data link Physical 7 6 5 4 3 2 1 Network Data link Data link Physical Physical Application Presentation Session Transport Network Data link Physical 7 6 5 4 3 2 1 PC 1 Intermediate PC 2 node link link For PC1 sends a message to PC2 Physical medium Physical medium Transport-layer protocol Session-layer protocol Presentation-layer protocol Application-layer protocol Data flow Peer communication within layer
Wrapping of data with necessary protocol (adding header or trailer or both) Why Data Encapsulation P ITo add control information(in form of header or trailer or both) n. The data after encapsulated is called ders are added to the data at layers 6, 5, 4, 3, and 2. Trailers are usually added only at layer2. The control information falls into the three categories: D Address: The address of the sender and/or receiver may be D Error-detecting code: some sort of frame check sequence 16005000181010 D Protocol control: additional information is included to implement the protocol functions such as: priority, quality service and security Functions of the Physical Layer Functions of the physical layer Physlca-01010111101 Line configuration-the connection of devices to the medium (point-to-point or multipoint configuration) 111 topology- the configuration for the devices to b orm a network(mesh topology, star topology, ring bus topology card). It also defines the type of transmission medium(e. g. Representation of bits- encoding the bit (Os The physical layer also defines th between two de electrical or optical signals. This layer also defines the type of ncoding(e. g. ASK or FSK on rate in term of number of bit sent Example for the physical layer protocol Synchronization of bits- the sender and the receiver clocks stAt ust be synchronized Functions of the data link le Functions of the Data Link Layer very, it eceiver is less than the rate produced in the yer will impose a flow control mechanism to prevent overwhelming network layer). It also take care of the following functions: mit damaged Framing- The data link layer divides the stream of bits received lost frames and also prevent duplication of frames. Error control is aye ta define sei si ah a ddress nf the s endes s beae ard esse to determine whid nd/or receiver(desti device has contr he link at any given time
4 哈工大计算机学院 李全龙 Network Application Development 1: Introduction 19 Data Encapsulation Application Presentation Session Transport Network Data link Physical 7 6 5 4 3 2 1 PC 1 PC 2 User data AH PH SH AH PH SH TH NH DT AH PH SH TH NH DH 10101010101011111110000000101010 A-PDU S-PDU P-PDU T-PDU N-PDU Application Presentation Session Transport Network Data link Physical 7 6 5 4 3 2 1 User data AH PH SH AH PH SH TH AH PH SH TH NH DT AH PH SH TH NH DH 10101010101011111110000000101010 A-PDU S-PDU P-PDU T-PDU N-PDU Network Wrapping of data with necessary protocol information before network transit (adding header or trailer or both) 哈工大计算机学院 李全龙 Network Application Development 1: Introduction 20 Why Data Encapsulation ? To add control information (in form of header or trailer or both) to the data being encapsulated in order to ensure accurate and secure communication. The data after encapsulated is called protocol data unit (PDU) The control information falls into the three categories: Address: The address of the sender and/or receiver may be indicated. Error-detecting code: some sort of frame check sequence Protocol control: additional information is included to implement the protocol functions such as: priority, quality of service and security Note: Headers are added to the data at layers 6,5,4,3, and 2. Trailers are usually added only at layer2. 哈工大计算机学院 李全龙 Network Application Development 1: Introduction 21 Functions of the Physical Layer 10101010111101 DL - PDU From data link layer Physical layer 10101010111101 DL - PDU To data link layer Physical layer • Physical characteristics of interfaces and media - interface between the devices and the transmission medium (e.g. network card). It also defines the type of transmission medium (e.g. wire) • Representation of bits - encoding the bit (0s and 1s ) into electrical or optical signals. This layer also defines the type of encoding (e.g. ASK or FSK) • Data rate - the transmission rate in term of number of bit sent each second (e.g. 56 Kb/s) • Synchronization of bits - the sender and the receiver clocks must be synchronized 哈工大计算机学院 李全龙 Network Application Development 1: Introduction 22 Functions of the Physical Layer • Line configuration - the connection of devices to the medium (point-to-point or multipoint configuration) • Physical topology - the configuration for the devices to be connected to form a network (mesh topology, star topology, ring topology or bus topology) • Transmission mode - The physical layer also defines the direction of transmission between two devices: Simplex, halfduplex, or full-duplex Example for the physical layer protocol: • RS-232 哈工大计算机学院 李全龙 Network Application Development 1: Introduction 23 Functions of the Data Link Layer 10101010111101 DT DH N - PDU Data link layer Frame To physical layer From network layer 10101010111101 DT DH N - PDU Data link layer Frame From physical layer To network layer The data link layer is responsible for node-to-node delivery, it makes the physical layer appear error free to the upper layer (network layer). It also take care of the following functions: • Framing - The data link layer divides the stream of bits received from the network layer into manageable data units called frames • Physical addressing - the data link layer adds a header to the frame to define the physical address of the sender (source address) and/or receiver (destination address) of the frame 哈工大计算机学院 李全龙 Network Application Development 1: Introduction 24 Functions of the Data Link Layer 20 25 32 48 62 DT Data 20 62 Trailer Source address destination address • Flow control - If the rate at which the data are absorbed by the receiver is less than the rate produced in the sender, the data link layer will impose a flow control mechanism to prevent overwhelming the receiver • Error control - mechanism that can detect and retransmit damaged or lost frames and also prevent duplication of frames. Error control is normally achieved by the trailer at the end of the frame • Access control - When one or more devices are connected to the same link, data link layer protocols are necessary to determine which device has control over the link at any given time
Functions of the Network Layer Functions of the Network Layer Routing- Router (or gateways) connect independent networks gether, network layer routes the packet to their final destination To data link layer From data link layer The network layer is responsible for the source-to-destination systems are connected to the same link, no need for a network layer. =: The above figure shows the ca and 79 are the local physical Functions of the Transport Layer Functions of the Transport Layer ↓1rNK Segmentation and rs and this layer also ensures the whole message arrive liftable segments (can be handled by ontains a sequence number (for correct re-assembling at the ort layer is responsible for This layer has more control over sequencing, flow and error c nning several programs)by including a service-point address(port address)in its header Functions of the e sessio on Layer Functions of the Transport Layer Connection control- The transport layer can be either conne ter all dat To transport layer transferred without error the connection is termina is th dialog Flow control- Transport layer perform end to end flow control which maintains, and synchronizes the differs from the data link layer which is le link. log control- The session layer allows two systems to enter into a Error either half-duplex (one way loss or duplication). Error correction checkpoints(synchronization points)into a stream of data, when da loss during transmission occurred, more efficient re-transmission can be 5
5 哈工大计算机学院 李全龙 Network Application Development 1: Introduction 25 Functions of the Network Layer N-PDU NH T- PDU Network layer packet To data link layer From transport layer N-PDU NH T- PDU Network layer packet From data link layer To transport layer • Logical addressing - the network layer adds a header to the incoming packet from the upper layer with a logical address of the sender. If a packet passes the network boundary, this universal (logical) address helps to distinguish whether the packet belong to the source or destination systems The network layer is responsible for the source-to-destination delivery of a packet possibly across multiple networks, if two systems are connected to the same link, no need for a network layer. The functions of a network layer are: 哈工大计算机学院 李全龙 Network Application Development 1: Introduction 26 Functions of the Network Layer • Routing - Router (or gateways) connect independent networks together, network layer routes the packet to their final destination by router (gateway). F R K L 15 D 78 79 DT Data S D 02 46 DT Data S D 23 09 DT Data S D 29 79 The above figure shows the case for a computer "S" communicating with a remote computer "D". S and D are the logical addresses of the source and destination computers respectively, where 02 and 79 are the local physical addresses of the source and destination computers respectively. T Ring Router Router U X 46 23 61 09 29 S A 02 37 C 哈工大计算机学院 李全龙 Network Application Development 1: Introduction 27 Functions of the Transport Layer T-PDU S- PDU Transport layer To Network layer From session layer TH TH TH T-PDU T-PDU T-PDU S- PDU Transport layer From Network layer To session layer TH TH TH T-PDU T-PDU segments segments • responsible for source-to-destination (end-to-end) delivery of the entire message • segmentation occurs and this layer also ensures the whole message arrives intact and in order • a logical path can be set up (fixed pathway) between the source and destination for all packets in a message for additional security. • This layer has more control over sequencing, flow and error detection and correction 哈工大计算机学院 李全龙 Network Application Development 1: Introduction 28 Functions of the Transport Layer Data x y DT Data-1 x y S D DH DT Data-2 x y S D DH Data-1 x y S D Data-2 x y S D Transport layer Network layer Data link layer S Data x y DT Data-1 x y S D DH DT Data-2 x y S D DH Data-1 x y S D Data-2 x y S D Transport layer Network layer Data link layer D Internet • Segmentation and re-assembly - A message is divided into transmittable segments (can be handled by network layer) each contains a sequence number (for correct re-assembling at the destination). • Service-point addressing - the transport layer is responsible for the delivery of the entire message to the correct process on the computer ( that may be running several programs) by including a service-point address (port address) in its header. 哈工大计算机学院 李全龙 Network Application Development 1: Introduction 29 Functions of the Transport Layer • Connection control - The transport layer can be either connectionless or connection-oriented. A connectionless transport layer deliver each segments as an independent packet to the destination. A connectionoriented transport layer firstly makes a connection with the transport layer at the destination, then deliver the packets and after all data are transferred without error, the connection is terminated. • Flow control - Transport layer perform end to end flow control which differs from the data link layer which is responsible for flow control in single link. • Error control - The transport layer performs end to end error control which make sure the entire message arrives at the receiving transport layer without error (damage, loss or duplication). Error correction is done by re-transmission. 哈工大计算机学院 李全龙 Network Application Development 1: Introduction 30 Functions of the Session Layer S-PDU P- PDU To transport layer From Presentation layer SH Session layer syn syn syn S-PDU P- PDU From transport layer To Presentation layer SH Session layer syn syn syn • Dialog control - The session layer allows two systems to enter into a dialog. The communication between two processes can be controlled in either half-duplex (one way at a time) or full-duplex (two ways at a time). The session layer is the network dialog controlling. It establishes, maintains, and synchronizes the interaction between communication systems. • Synchronization - The session layer allows a process to add checkpoints (synchronization points) into a stream of data, when data loss during transmission occurred, more efficient re-transmission can be performed