Computer Networks Network architecture



Similar documents
Data Communication Networks. Lecture 1

ICT SEcurity BASICS. Course: Software Defined Radio. Angelo Liguori. SP4TE lab.

Tutorial on Socket Programming

The POSIX Socket API

What is CSG150 about? Fundamentals of Computer Networking. Course Outline. Lecture 1 Outline. Guevara Noubir noubir@ccs.neu.

ELEN 602: Computer Communications and Networking. Socket Programming Basics

Introduction to Socket Programming Part I : TCP Clients, Servers; Host information

Unix Network Programming

Socket Programming. Kameswari Chebrolu Dept. of Electrical Engineering, IIT Kanpur

Socket Programming. Srinidhi Varadarajan

Note! The problem set consists of two parts: Part I: The problem specifications pages Part II: The answer pages

Implementing Network Software

Computer Networks CS321

Operating Systems Design 16. Networking: Sockets

Strategies. Addressing and Routing

Computer Networks UDP and TCP

Transport Layer Protocols

Lecture 2: Protocols and Layering. CSE 123: Computer Networks Stefan Savage

Basic Networking Concepts. 1. Introduction 2. Protocols 3. Protocol Layers 4. Network Interconnection/Internet

Network Programming with Sockets. Process Management in UNIX

Objectives of Lecture. Network Architecture. Protocols. Contents

NS3 Lab 1 TCP/IP Network Programming in C

Socket Programming. Request. Reply. Figure 1. Client-Server paradigm

Indian Institute of Technology Kharagpur. TCP/IP Part I. Prof Indranil Sengupta Computer Science and Engineering Indian Institute of Technology

Networks. Inter-process Communication. Pipes. Inter-process Communication

Ethernet. Ethernet. Network Devices

UNIX Sockets. COS 461 Precept 1

Transport Layer. Chapter 3.4. Think about

Layered Architectures and Applications

Programmation Systèmes Cours 9 UNIX Domain Sockets

Protocols and Architecture. Protocol Architecture.

Note! The problem set consists of two parts: Part I: The problem specifications pages Part II: The answer pages

Computer Networks Homework 1

Understanding TCP/IP. Introduction. What is an Architectural Model? APPENDIX

Mobile IP Network Layer Lesson 02 TCP/IP Suite and IP Protocol

Final for ECE374 05/06/13 Solution!!

Overview of Computer Networks

Network Layer IPv4. Dr. Sanjay P. Ahuja, Ph.D. Fidelity National Financial Distinguished Professor of CIS. School of Computing, UNF

TCP/IP Network Essentials. Linux System Administration and IP Services

transmission media and network topologies client/server architecture layers, protocols, and sockets

Computer Networks/DV2 Lab

ICOM : Computer Networks Chapter 6: The Transport Layer. By Dr Yi Qian Department of Electronic and Computer Engineering Fall 2006 UPRM

EE4367 Telecom. Switching & Transmission. Prof. Murat Torlak

Lecture 28: Internet Protocols

Network-Oriented Software Development. Course: CSc4360/CSc6360 Instructor: Dr. Beyah Sessions: M-W, 3:00 4:40pm Lecture 2

Lecture 1: Course Introduction" CSE 222A: Computer Communication Networks Alex C. Snoeren

Network Programming TDC 561

Agenda. Distributed System Structures. Why Distributed Systems? Motivation

Chapter 9. IP Secure

Lab 4: Socket Programming: netcat part

Computer Networks & Security 2014/2015

How To Understand The Layered Architecture Of A Network

EITF25 Internet Techniques and Applications L5: Wide Area Networks (WAN) Stefan Höst

Chapter 3. Internet Applications and Network Programming

A host-based firewall can be used in addition to a network-based firewall to provide multiple layers of protection.

Computer Networks. Chapter 5 Transport Protocols

Generalised Socket Addresses for Unix Squeak

Transport and Network Layer

Introduction To Computer Networking

Socket Programming in C/C++

Network Layers. CSC358 - Introduction to Computer Networks

The OSI & Internet layering models

Architecture and Performance of the Internet

CPS221 Lecture: Layered Network Architecture

Overview. Securing TCP/IP. Introduction to TCP/IP (cont d) Introduction to TCP/IP

Computer Network. Interconnected collection of autonomous computers that are able to exchange information

Per-Flow Queuing Allot's Approach to Bandwidth Management

Introduction to Computer Networks

CSIS CSIS 3230 Spring Networking, its all about the apps! Apps on the Edge. Application Architectures. Pure P2P Architecture

Protocols. Packets. What's in an IP packet

First Workshop on Open Source and Internet Technology for Scientific Environment: with case studies from Environmental Monitoring

Network Security TCP/IP Refresher

Porting applications & DNS issues. socket interface extensions for IPv6. Eva M. Castro. ecastro@dit.upm.es. dit. Porting applications & DNS issues UPM

IT304 Experiment 2 To understand the concept of IPC, Pipes, Signals, Multi-Threading and Multiprocessing in the context of networking.

Frequently Asked Questions

The OSI model has seven layers. The principles that were applied to arrive at the seven layers can be briefly summarized as follows:

ICS 153 Introduction to Computer Networks. Inst: Chris Davison

Access Control: Firewalls (1)

A Transport Protocol for Multimedia Wireless Sensor Networks

[Prof. Rupesh G Vaishnav] Page 1

The OSI Model and the TCP/IP Protocol Suite PROTOCOL LAYERS. Hierarchy. Services THE OSI MODEL

R2. The word protocol is often used to describe diplomatic relations. How does Wikipedia describe diplomatic protocol?

>>> SOLUTIONS <<< c) The OSI Reference Model has two additional layers. Where are these layers in the stack and what services do they provide?

The TCP/IP Reference Model

IP - The Internet Protocol

Chapter 2 - The TCP/IP and OSI Networking Models

IP Network Layer. Datagram ID FLAG Fragment Offset. IP Datagrams. IP Addresses. IP Addresses. CSCE 515: Computer Network Programming TCP/IP

IP address format: Dotted decimal notation:

EXPLORER. TFT Filter CONFIGURATION

Internet Architecture and Philosophy

Slide 1 Introduction cnds@napier 1 Lecture 6 (Network Layer)

Communication Networks. MAP-TELE 2011/12 José Ruela

Technical Support Information Belkin internal use only

Session NM059. TCP/IP Programming on VMS. Geoff Bryant Process Software

Network Performance: Networks must be fast. What are the essential network performance metrics: bandwidth and latency

Network Models OSI vs. TCP/IP

Overview of TCP/IP. TCP/IP and Internet

Socket = an interface connection between two (dissimilar) pipes. OS provides this API to connect applications to networks. home.comcast.

PART OF THE PICTURE: The TCP/IP Communications Architecture

The exam has 110 possible points, 10 of which are extra credit. There is a Word Bank on Page 8. Pages 7-8 can be removed from the exam.

Transcription:

Computer Networks Network architecture Saad Mneimneh Computer Science Hunter College of CUNY New York - Networks are like onions - They stink? - Yes, no, they have layers Shrek and Donkey 1 Introduction (ISO OSI, IETF, and Shrek standard) When designing complex systems, such as a network, a common engineering approach is to use the concepts of modules and modularity. In this approach, the design of the system evolves by breaking the big task into smaller tasks. Each module is responsible for a specific task and provides services to the other modules to accomplish their tasks. We can interact with a module as a black box that provides certain functionality without knowing the details of how it works. We only need to know how to interface with the module. Someone can remove the module and update it with a newer one, and we would still be able to continue our work in the same way. Moreover, modularity is important to simplify tasks (divide and conquer). For instance, in a network, reliability of message delivery and routing of messages can be treated separately by different modules. Changing one would not impact the other. If a better routing procedure is employed, it only affects the module responsible for it. Certainly, we do not desire a change in routing to affect our ability to reliably deliver messages. Modules often interact in a hierarchy. A network is designed as a hierarchical or layered architecture in which every module or layer provides services to the upper layer. Users, sitting at the top layer of the network, communicate as if there is a virtual link between them, and need not be aware of the details of the network. The following figure illustrates the standardized 7 layers of a network. A description of each one follows. 1

user user application application virtual network service presentation virtual session presentation session virtual link for end to end messages session transport virtual link for end to end s transport network virtual link for network network network data link control reliable s virtual bit pipe data link control physical physical physical physical physical in out in out physical external site physical link subnet node subnet node external site Figure 1: Network architecture: the 7 layers of each node in the network 1.1 The top layers 1.1.1 Application layer This is the application that is used to access the network. Each application performs something specific to the user needs, e.g. browsing the web, transferring files, sending email, etc... 1.1.2 Presentation layer The main functions of the presentation layer are data formats, data encryption/decryption, data compression/decompression, etc... 1.1.3 Session layer Mainly deals with access rights in setting up sessions, e.g. who has access to particular network services, billing functions, etc... There is not a strong agreement about the definition of these three top layers. Usually the focus is on the layer, the Network layer, and the layer.

1.2 layer While the network layer (see section below) provides end-to-end pipe to the transport layer, the transport layer provides end-to-end message service to the top layers. message service layer layer pipe Figure 2: and network layers Functions of the transport layer include: Breaking messages into s and reassembling s into messages (s of suitable size to network) Resequencing s at destination to retrieve correct order (e.g. Datagram) Achieving end-to-end reliable communication in case network is not reliable, recover from errors and failures (arbitrary networks can join the Internet!) Flow control to prevent a fast sender from overrunning a slow receiver Examples of transport protocols for the Internet are TCP (Transmission Control Protocol) and UDP (User Datagram Protocol). When combined with the IP protocol at the network layer, we refer to TCP as TCP/IP. 1.3 Network layer The main function of the network layer is to route each to the proper outgoing or to the transport layer (if the node is the destination). Typically, the network layer adds its own header (e.g. source/destination or VC number) to the received from the transport layer to accomplish this routing function. layer Network layer 1 2 3 Figure 3: Routing Headers represent a general mechanism across the layers. Each layer/protocol provides a service to the upper layer/protocol, and peer processes/protocols communicate

information through the headers. The layer adds also a Trailer for error detection and correction. service interface Network peer-to-peer interface Figure 4: Headers and Trailers 1.4 layer The layer is responsible for error-free transmission of s over a single link. The goal is to ensure that every is delivered once, only once, without errors, and in order. To accomplish this task, adds its own header/trailer. For instance, the header may contain sequence numbers to ensure delivery of s in order. The thus modified is called a frame. Framing is an important issue in networks and will be discussed later. 1.5 Physical layer The physical layer is responsible for the actual transmission of bits over a link. This layer is usually the network hardware. Higher layers, like, must deal with transmission errors due to noise and signal power loss. A simple model for the physical layer is the Binary Symmetric Channel with a probability p of flipping each bit independently, i.e. p{0 1 = p{1 0 = p. However, in practice errors are bursty. There are a number of delays associated with the physical transmission: Propagation delay: time it takes for signal to travel from one end of link to another = distance/speed of light Bandwidth: number of bits that can be transmitted over a period of time, i.e. bits per second (bps) Latency of = Propagation delay + size of /Bandwidth + Queuing delay RTT = Round Trip Time for exchanging small messages 2(Propagation delay + Queuing) 2 The hourglass shape (an alternative view) Despite the hierarchical nature, Internet architecture does not imply strict layering. Many times there are multiple protocols provided at a given layer in the system, giving

Application HTTP FTP DNS TFTP TCP UDP Network IP Link e.g. Ethernet net 1 net 2 net n Figure 5: Hourglass shape an hourglass shape to the architecture. An application is free to bypass the defined transport layers and to directly use IP. IP serves as a focal point (common method for exchanging s among networks): many transport protocols lie above IP (define services), and many networks technologies lie below IP. 3 Network software Most network protocols are implemented in software (that s one of the main reasons for the Internet s success). All computer systems implement their protocols as part of the operating system. The operating systems exports the network functionality as a Network Application Programming Interface (API). Some API is widely accepted and supported: the socket interface. The main abstraction of the socket interface is the socket: a point where the local application process attaches to the network. The API specifies ways to create sockets attach the socket to the network send/receive through the socket close the socket 3.1 Create a socket The following C function creates a socket: int socket (int domain, int type, int protocol) The parameters are as follows: domain: specifies a protocol family PF INET denotes the Internet family PF UNIX denotes the Unix pipe family PF PACKET denotes direct access to the network interface, i.e. bypass TCP

type: specifies the semantics of the communication SOCK STREAM denotes a byte stream SOCK DGRAM denotes a message oriented service protocol: identifies a specific protocol to be used, in our case we can simply ignore it because the combination PF INET and SOCK STREAM implies TCP The return value is an identifier of the newly created socket 3.2 Server The following C functions are often used by a server: int bind(int socket, sockaddr * address, int addr_len) int listen(int socket, int backlog) int accept(int socket, sockaddr * address, int * addr_len) The bind operation binds the socket to the network address, a data structure that includes IP address TCP port (a port is used to identify the process) The listen operation defines how many connections can be pending on a given socket. The accept operation is a blocking operation that does not return until a remote participant has established a connection. It returns a new socket that corresponds to just this connection, and the address parameter will contain the remote participant s address. 3.3 Client The following C function is often used by a client: int connect(int socket, sockaddr * address, int addr_len) The connect operation does not return until TCP has successfully established a connection. The address will contain the remote participants (server) address. The client does not typically care which port it uses, OS simply selects an unused one. Once a connection is established, the client can use the following functions to send and receive data: int send(int socket, char * message, int msg_len, int flags) int recv(int socket, char * buffer, int buf_len, int flags)

3.4 Example server #include <iostream> #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <unistd.h> using std::cout; using std::cin; const unsigned short int port = 5432; const int max_pending = 1; const int max_len = 256; int main() { sockaddr_in address; //address sockaddr_in client_address; //client address char message[max_len]; int s; int new_s; int len; //build address bzero((char *)&address, sizeof(address)); address.sin_family = AF_INET; address.sin_addr.s_addr = htonl(inaddr_any); address.sin_port = htons(port); //setup passive open if ((s=socket(pf_inet, SOCK_STREAM, 0)) < 0) { cout<<"error in socket"; //bind socket to address if (bind(s, (sockaddr *)&address, sizeof(address)) < 0) { cout<<"error in bind"; if (listen(s, max_pending) < 0) { cout<<"error in listen"; //wait for connection, then receive message socklen_t size;

while (1) { if ((new_s = accept(s, (sockaddr *)&client_address, &size)) < 0) { cout<<"error in accept"; while (len = recv(new_s, message, sizeof(message), 0)) cout<<message<<"\n"; close(new_s); 3.5 Example client #include <iostream> #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <unistd.h> using std::cout; using std::cin; const unsigned short int port = 5432; int main() { int s; sockaddr_in address; bzero((char *)&address, sizeof(address)); address.sin_family = AF_INET; address.sin_port = htons(port); address.sin_addr.s_addr = htonl(inaddr_any); //my IP address //active open if ((s=socket(pf_inet, SOCK_STREAM, 0)) < 0) { cout<<"error in socket"; //connect if (connect(s, (sockaddr *)&address, sizeof(address)) < 0) { cout<<"error in connect"; close(s);

char message[256]; while(cin.getline(message, 256, \n )) { if (strlen(message) == 0) break; send(s,message,strlen(message)+1,0); close(s); References Dimitri Bertsekas and Robert Gallager, Data Networks Larry Peterson and Bruce Davie, Computer Networks: A Systems Approach