Programmation système

Similar documents
P2 A networking program usually has two programs, each running on a different host, communica9ng with each other. The program that ini9ates the

OSI Transport Layer. Network Fundamentals Chapter 4. Version Cisco Systems, Inc. All rights reserved. Cisco Public 1

CN1047 INTRODUCTION TO COMPUTER NETWORKING CHAPTER 6 OSI MODEL TRANSPORT LAYER

Homework 2 50 points. CSE422 Computer Networking Spring 2018

UNIT IV -- TRANSPORT LAYER

Network Model: Each layer has a specific function.

CSCD 330 Network Programming

Answers to Sample Questions on Transport Layer

Data Transport over IP Networks

CCNA Exploration Network Fundamentals. Chapter 04 OSI Transport Layer

Connectionless and Connection-Oriented Protocols OSI Layer 4 Common feature: Multiplexing Using. The Transmission Control Protocol (TCP)

COMP750. Distributed Systems. Network Overview

Lecture (11) OSI layer 4 protocols TCP/UDP protocols

4.0.1 CHAPTER INTRODUCTION

L6: OSI Reference Model

Introduction to TCP/IP networking

Lecture 9: Transpor Layer Overview and UDP

System Programming. Introduction to computer networks

COSC4377. Useful Linux Tool: screen

Chapter 7 Transport Layer. 7.0 Introduction 7.1 Transport Layer Protocols 7.2 TCP and UDP 7.3 Summary

TCP/IP protocol suite

Transport Layer. Gursharan Singh Tatla. Upendra Sharma. 1

Chapter 3: Transport Layer Part A

CS 5520/ECE 5590NA: Network Architecture I Spring Lecture 13: UDP and TCP

TCP/IP THE TCP/IP ARCHITECTURE

3.2 COMMUNICATION AND INTERNET TECHNOLOGIES

CCNA R&S: Introduction to Networks. Chapter 7: The Transport Layer

CSC358 Week 4. Adapted from slides by J.F. Kurose and K. W. Ross. All material copyright J.F Kurose and K.W. Ross, All Rights Reserved

Summary of Data Communications

EEC-484/584 Computer Networks

TSIN02 - Internetworking

Announcement. Homework 1 due last night, how is that? Will discuss some problems in the lecture next week

Chapter 2 - Part 1. The TCP/IP Protocol: The Language of the Internet

CS 421: Computer Networks SPRING MIDTERM I April 7, minutes

Chapter III: Transport Layer

Transport Layer. The transport layer is responsible for the delivery of a message from one process to another. RSManiaol

STEVEN R. BAGLEY PACKETS

precise rules that govern communication between two parties TCP/IP: the basic Internet protocols IP: Internet protocol (bottom level)

TSIN02 - Internetworking

THE TRANSPORT LAYER UNIT IV

ELEN Network Fundamentals Lecture 15

Internet transport-layer protocols. Transport services and protocols. Sending and receiving. Connection-oriented (TCP) Connection-oriented

Concept Questions Demonstrate your knowledge of these concepts by answering the following questions in the space provided.

The Transmission Control Protocol (TCP)

TDTS06: Computer Networks

Scribe Notes -- October 31st, 2017

AN exam March

Chapter 3: Transport Layer

Announcements. No book chapter for this topic! Slides are posted online as usual Homework: Will be posted online Due 12/6

OSI Transport Layer. objectives

CS 3516: Computer Networks

Lecture (02) Network Protocols and Standards

Transport Layer TCP & UDP Week 7. Module : Computer Networks Lecturers : Lucy White Office : 324

Peer-to-Peer Protocols and Data Link Layer. Chapter 5 from Communication Networks Leon-Gracia and Widjaja

CMPE 80N: Introduction to Networking and the Internet

NT1210 Introduction to Networking. Unit 10

CSC 401 Data and Computer Communications Networks

Lecture 5. Transport Layer. Transport Layer 1-1

Overview of TCP/IP Overview of TCP/IP protocol: TCP/IP architectural models TCP protocol layers.

Networking interview questions

TSIN02 - Internetworking

SC/CSE 3213 Winter Sebastian Magierowski York University CSE 3213, W13 L8: TCP/IP. Outline. Forwarding over network and data link layers

Networking and Internetworking 1

Chapter 2 Network Models 2.1

Operating Systems CS 571

Position of IP and other network-layer protocols in TCP/IP protocol suite

CSCI-GA Operating Systems. Networking. Hubertus Franke

Unit 2.

CMSC 332 Computer Networks Reliable Data Transfer

b) Diverse forms of physical connection - all sorts of wired connections, wireless connections, fiber optics, etc.

CCNA 1: Chapter 2 Exam Answer v %

CPS221 Lecture: Layered Network Architecture

Part VI. Appendixes. Appendix A OSI Model and Internet Protocols Appendix B About the CD

User Datagram Protocol

Chapter 6. (Week 12) The Transport Layer (CONTINUATION) ANDREW S. TANENBAUM COMPUTER NETWORKS FOURTH EDITION PP

Concept Questions Demonstrate your knowledge of these concepts by answering the following questions in the space that is provided.

Review of Important Networking Concepts

Chapter 3 Transport Layer

Chapter 3 Transport Layer

Internet and Intranet Protocols and Applications

CSC 4900 Computer Networks: Reliable Data Transport

Chapter -4 OSI Reference Model

ECE 650 Systems Programming & Engineering. Spring 2018

(Refer Slide Time: 1:09)

No book chapter for this topic! Slides are posted online as usual Homework: Will be posted online Due 12/6

Defining Networks with the OSI Model. Module 2

Chapter 2 Network Models 2.1

CMPE 150/L : Introduction to Computer Networks. Chen Qian Computer Engineering UCSC Baskin Engineering Lecture 7

Chapter 7. Local Area Network Communications Protocols

Guide To TCP/IP, Second Edition UDP Header Source Port Number (16 bits) IP HEADER Protocol Field = 17 Destination Port Number (16 bit) 15 16

CC451 Computer Networks

Lecture (03) Network Model

TCP/IP Protocol Suite 1

CSCD 330 Network Programming

Computer Networking : Principles, Protocols and Practice

Networks: Access Management

Module 2 Overview of Computer Networks

Module 2 Overview of. Computer Networks

Transport services and protocols. Chapter 3 outline. Internet transport-layer protocols Chapter 3 outline. Multiplexing/demultiplexing

Lecture (03) Networking Model (TCP/IP) Networking Standard (OSI) cont.,..

Transcription:

Programmation système Problems Problem 1 - Message from ATM to Server Message name HELLO {userid} PASSWORD {password} BALANCE WITHDRAWAL {amount} Purpose Let server know that there is a card in the ATM machine ATM card transmists userid to the server User enters PIN, which is sent to the server User requests balance User asks to withdraw money User is all done - Message from Server from ATM Message name Purpose PASSWORD Ask user for PIN (password) OK Last requested operation (PASSWORD, WITHDRAWAL) is OK ERROR Last requested operation (PASSWORD, WITHDRAWAL) is ERROR AMOUNT {amount} Sent in response to BALANCE request User is done, display welcome screen at ATM

- Diagram of protocol: Simple withdrawal with no error HELLO {userid} PASSWORD PASSWORD {password} OK BALANCE (check if user is valid) (check password) (password is OK) (ATM dispenses money) AMOUNT {amount} WITHDRAWAL {amount} OK (check if enough money to cover withdrawal) - Assumptions made by the protocol Connection oriented: secure connection required between client and server Reliable transport: data cannot be lost or received in wrong order Flow control: the total amount of data transferred is small

- FSM Problem 2 Client program: A piece of software that accesses a service made available by a server. Server program: It s a service that shares information to its clients No, it s the other way around. The client requests and receives services from the server. A networking program usually has two programs, each running on a different host, communicating with each other. The program that initiates the communication is the client. Typically, the client program requests and receives services from the server program. Problem 3 At first, the communication goes through all the layer. But then the legal departments and the presidents start talking to each other directly without going through the engineer department. In the OSI protocol model, physical communication between peers takes place only in the lowest layer, not in every layer.

Problem 4 Byte stream =? Message stream A reliable byte stream is a communication protocol that sends a continuous flow of data. A reliable message stream is a communication protocol that sends distinct chunks of data Problem 5 Negotiation has to do with getting both sides to agree on some parameters or values to be used during the communication. Maximum packet size is one example, but there are many others. Problem 6 Same: - Layers : network, transport, application - Transport severice can provide a reliable end-to-end byte stream. Difference: - TCP/IP makes no assumptions about what happens above the level of a network session (part of OSI Layer 5), while OSI defines several more layers of standardized functions - TCP/IP makes no prescriptions as to the link layers below IP, where OSI specifies two. - OSI follows vertical approach as TCP/IP follows horizontal approach - OSI has both connection oriented and connectionless service in the network layer Problem 7 - Data link Layer - Network layer Problem 8 - The protocols of a network are fairly complex. Designing them in layers makes their implementation more manageable. - Layering of protocols provides well-defined interfaces between the layers, so that a change in one layer does not affect an adjacent layer. That is the various functionalists can be partitioned and implemented independently, so that each one can be changed as technology improves without the other ones being affected. For example, a change in a routing algorithm of a network control program should not after affect the functions of message sequencing, which is located in another layer of the network architecture. Problem 9 TCP is a connection-oriented protocol while UDP is a connectionless protocol.

Problem 10 In other words, TCP requires an active connection in order to deliver a message while UDP does not. If there is a connection failure during a TCP transaction, the server will request the lost part: there will not be any corruption. This is not the case with UDP: there might be corruption since when you send a message, there is no way to know if it will reach its destination. Connection-oriented communication has 3 phases: 1. In the establishment phase a request is made to set up a connection 2. Only after this phase has been successfully completed can the data transfer phase be started and the data transported 3. Then comes the release phase. Connectionless communication does not have these phases. It just sends the data. Problem 11 In this case, frames encapsulate packets: indeed, when a packet reaches the data link layer, the entire packet including its header, the data, and everything else is being packed into the data field of the frame. Sometimes, this might not be possible if the packet does not fit. In this case, it has to be split into several smaller frames for a single packet. Problem 12 Since each layer adds its own h-byte header, the total length of the message is: Headers = n h Total = M + Headers Total = M + n h Hence the fraction of the network bandwidth filled with headers is: Problem 13 F = Headers Total F = n h M + n h Depending on the reliability of the network, it may be wise to use the first or the second approach. If the network tends to lose packets, it is better to chop the file into several packets so lost packets can be retransferred. However, if the network is reliable, it is more interesting to send the whole file without acknowledge each packet individually: this will help to save bandwidth. Unfortunately, in rare cases, if there has been a packet loss, the entire file will have to be resent.

Problem 14 In the case of a NAK-only protocol, if the sender sends data only infrequently, he will not know if the current package has been received or not until he sends the next packet. Due to the low frequency of the transactions, it will take a long time to recover the first packet. In this case, the sender should use ACKs. In other words: In a NAK only protocol, the loss of packet x is only detected by the receiver when packet x+1 is received. That is, the receivers receive x-1 and then x+1, only when x+1 is received does the receiver realize that x was missed. If there is a long delay between the transmission of x and the transmission of x+1, then it will be a long time until x can be recovered, under a NAK only protocol. On the other hand, if data is being sent often, then recovery under a NAK-only scheme could happen quickly. Moreover, if errors are infrequent, then NAKs are only occasionally sent (when needed), and ACK are never sent a significant reduction in feedback in the NAK-only case over the ACK-only case. However, if the sender has a lot of data, it is interesting to use a NAK-only protocol since it will be significantly faster than a protocol that uses ACKs: since errors should be much less frequents than successes, there will be much less acknowledgments to be expected, thus a faster transaction.

Problem 15 Entity A: packet=make_pkt(data) udt_send(packet) Wait : send to B Wait : receive from B rdt_receive(packet) extract(packet,data) deliver_data(data) Entity B: packet=make_pkt(data) udt_send(packet) Wait : send to A Wait : receive from A rdt_receive(packet) extract(packet,data) deliver_data(data) Sometimes, speed is preferred over reliability; for video games or streaming an occasional packet loss is tolerable and preferred over lagging. In these cases, unreliable communication is preferred over reliable communication.