Peer to Peer Instant Messaging

Size: px
Start display at page:

Download "Peer to Peer Instant Messaging"

Transcription

1 Peer to Peer Instant Messaging Assignment in Data communication I, Department of Information Technology, Uppsala University. Overview In this programming exercise you will implement a peer to peer instant messaging system based around a simple program that is provided to you. The program provided exchanges text messages between peers using direct TCP communication between two copies of the peer process executing on the same machine. The assignment asks you to extend the program to implement a more general messaging functionality based on a defined messaging protocol. The final system will provide a combination of features possibly including both point to point, and multicast message delivery to UID s on any host. Host and ID discovery will be implemented via the peer network using a control message protocol to maintain a distributed name lookup service among the peers. The degree to which the project should be completed depends on the course in which you take elements of this project. Course stages are allocated to subjects as follows (if not stated differently by the examiner). ITP DatorsysII (del 1), Datakom, Stages 1 and 2. Distance course, Datakom, Stages 1 and 2. MNP Datakom, Stages 1 and 2. DVP Datakom, Stages 1 to 3. 1 General Problem Description The program to be developed in this assignment should implement several aspects of a peer to peer messaging application. The application is implemented using TCP communication and a simple packet based message structure. 1

2 The initial peer implementation code provided with this problem description sets up a server communication socket based on the UID of the person using the client. The UID is stored in a text file named.p2prc or can be specified on the command line by running peer <UID>. The peer has a simple user interface providing three commands MESG, DISP, and QUIT. Using the MESG command and a UID, a peer can try to connect to a copy of itself that is also running on localhost (or IP address ). If the requested peer is executing, a connection is established and messages can be exchanged. The current message is just a text string, and does not represent the structure of the packets that should actually be exchanged between the peers. The DISP command is used to display an incoming message. To complete this laboratory you need to extend the existing code to implement the facilities and application protocols specified in the assignment stages appropriate to your course. Each stage builds on top of previous stages, so you can extend your code from a previous stage when moving forward in the assignment. Stages should be created as separate source code and executable files named peer1, peer2, etc. See section 3 for more information about hand-in instructions. It is important that you follow these instructions to pass the assignment! The code is provided as a tar-ball. The contents is as follows: p2p/ -- code_lib/ : Contains library code (DO NOT MODIFY). -- ns_source/ : Nameserver source code. -- p2p_source/ -- base/ : Contains your peer source code. -- copy/ : Copies of your compiled programs. -- serv_test/ : Program to test the name server. Figure 1: Directory structure of source code tree. 1.1 Important Things to Think About Help routines and support code can be found in the code lib/ directory. Study that code and the peer.c code skeleton to familiarize yourself with the assignment. It should be noted that no modifications of the library code should be necessary to complete the assignment. All packets should be sent in network byte order independent of the type of hardware/cpu the code is running on. This means that the code should use the funtions htonl(), ntohl(), htons(), etc. for the data that is sent on the network. 2

3 If you have access to for example a Linux machine, you can easily detect byte order bugs by running one peer on a SUN machine and one peer on the Linux machine and have them communicate with each other. Run your own local nameserver for easier debugging while coding. Good Luck! 3

4 2 Project Stages Stage 1: A Simple Message Protocol In short: 1. Define and implement a new packet format. 2. Extend code to handle multiple peers. 3. Extend code to buffer and handle multiple messages on a per peer basis. 4. Implement a PEER command to list currently connected peers. Modify and extend the current implementation to implement message passing between peers via user interaction. You may continue to assume that both peers are executing on the same physical computer. Start the assignment by copying the peer.c file into a file called peer1.c. Then edit the Makefile in the same directory to match the new target. You need to extend a simple command line interface to which allows a user to send a message to the other user. The primitive implementation of the command language is defined as follows. command :: message display quit message :: MESG <UID> <textblock> display :: DISP <UID> quit :: QUIT UID :: *[0-9] textblock :: *<alphanumeric> To send a message to a given UID one types the keyword MESG followed by the desired UID and an alphanumeric text message of up to N characters. The UID must be delimited by spaces in both commands. Your program need not parse commands for correct grammar, you can assume that all commands are well formed. Your program should extract the relevant data from a MESG command, check that the UID specified is known to the peer, and pack and send the text to the other peer (UID) according to the packet format in figure 2. I.e. you need to change the current implementation that only sends an ASCII string to instead send a binary header in front of the message. Currently no packet format is defined in the code, so you will be required to implement this yourself. The current command line implementation of the DISP command does not require a UID, since only one other peer process can be connected to 4

5 another. You should extend the program to allow connections to many peers simultaneously and implement a command PEER that prints the curerntly connected peers (e.g. IP address, number of received messages, etc.). You will also need to extend the message notification and buffering, and the DISP command to allow buffering and display of messages according to UID Type Reserved UID Length Message... Figure 2: Message packet format The packet format contains the following fields: Type: An integer describing the type of the message. Reserved: Field reserved for future usage, sent as 0. UID: The User ID of the sender. Length: An integer with the length of the message. Message: An arbitrary length string with the message. In your extended version of the program, when the UID is not known to the peer it should attempt to create a socket connection to that UID peer on localhost, setting up appropriate data structures to manage such a communication. If a connection can be established the message can then be sent using the defined packet format. If the connection is not possible the user should be notified that the message could not be delivered. The length of the message is specified in the packet so that the server will know how many bytes to read from the stream to get the entire message. The source UID is specified, as the recipient of a connection request will not know the UID of the requestor. Consequently we need to have that information in the packets so that the peer that accepts the connection can make an entry in the list of UID s with which it has a connection and can exchange messages directly. The type field is not really needed at this point, but will later be used to differentiate between protocol control packets and the data packets containing message data. 5

6 When a message is received the peer should notify the user of the messaging application that a message has arrived, and from which UID that message has arrived. Messages should be buffered in a FIFO queue of messages until the user issues a DISP command to display the next waiting message from the specified UID. Displaying a message should automatically delete it from the queue. To handle multiple peers and queueing of messages you can use linked lists. Library code implementing simple linked list routines are provided in code lib/. The linked list library is provided for your convenience. Note though, that the library routines implementing the linked lists do not deal with memory management, so make sure you free the memory allocated by the data structures you have added to the list when you detatch them. Testing Test that your peer code can communicate properly with copies of itself with different UID s. You should test several copies and connect in different orders to each of the copies by issuing MESG commands to different destinations. Test your assumptions about packet format by trying to exchange messages with peer implementations written by your classmates. Questions Answer the following questions related to the solution to stage 1 of the laboratory exercise. Each question should be answered using no more than 250 words to explain your reasoning. 1. What is the limit on the length of messages, if any? 2. Is there a limit on the total number of other peers that you can communicate with? 3. Does your implementation limit the number of messages queued in the peer waiting to be read? What are these limits? 4. There is another key protocol weakness with respect to UID s. What might this weakness be, and what steps can be taken to help address it? 5. Consider the implications of using UDP instead of TCP connections in your peer communications. What differences in efficiency might result, and in what circumstances? 6

7 Stage 2: Distributed Messaging and a Control Protocol In short: 1. Implement nameserver registration. 2. Implement nameserver interaction for UID to IP lookups. 3. Extend the peer program to be able to communicate between different hosts. Extend the code from stage 1 (by copying peer1.c to a file called peer2.c), so that it connects (via TCP) to a nameserver database. Initially you should connect to a copy of the nameserver running on your own machine localhost and test that your peer application interacts correctly with the server, and can properly register itself and do IP lookups for UID s. Consult the serv test code if you are unsure how to communicate with the name server and need some practical examples of registration and query messages. The structure of the command protocol that we use to interact with the nameserver is as follows. control :: lookup response register lookup :: LRQ <UID> response :: RSP <UID> <IPAdr> register :: PRG <UID> <IPAdr> UID :: *[0-9] When your peer is running correctly with a local nameserver you should start to use the public nameserver that is running on rama.it.uu.se at port This will provide a central point where you can register your UID and IP, and lookup the current UID s of chat peers for your friend s UID s. The command protocol grammar is defined below. Modify the connection algorithm for a message to attempt a connection on the current machine, and if that fails to use the control message protocol described below to look up the host s location (IP Address) for the required peer (UID) on the centralised nameserver. To access nameserver services your peer must connect to rama.it.uu.se port number 6345 which operates as a default name lookup database. If no valid IP can be retrieved report to the user that the UID cannot be discovered and that the message is undeliverable. To communicate with the name server we send a shorter packet type which is used to convey commands between peers instead of messages. This packet type is depicted in figure 2 and is pre-defined for you in globals.h as the type nsr pkt. 7

8 Type Reserved UID (1) UID (2) IP Address (1) IP Address (2) Figure 3: Control/Command packet format. Not all fields of the command packet are filled in for all packet types, since it is a general purpose packet format. The fields are specified as follows: Type: An integer describing the type of the message (defined in globals.h). Reserved: Field reserved for future usage, sent as 0. UID (1): User ID #1 (different meaning depending on the packet type). UID (2): User ID #2 (different meaning depending on the packet type). IP Address (1): An IP Address corresponding to UID (1). IP Address (2): An IP Address corresponding to UID (2). Don t forget to modify your code to replace the code that always connects to localhost with code that uses the IP address that you have stored in your local UID lookup table. Testing Once again, test your peer code can communicate properly with copies of itself with different UID s on the same computer. Extend the tests to place the peers on different computers and test the command protocol by looking up UIDs on the central nameserver running on rama.it.uu.se. Now try to exchange messages with peer implementations written by your classmates. Questions Answer the following questions related to the solution to stage 2 of the laboratory exercise. Each question should be answered using no more than 250 words to explain your reasoning. 1. What important functionality is missing from the control protocol? Are there significant implications for the functionality of the system over time as a result of the design flaw? 8

9 2. Reflect on the peer discovery problem. How is it resolved in the system you have built? How reliable is this solution, and how might it be made more robust? 3. How can you find out what peer UIDs are in existence, and how can you record the UIDs of friends between sessions of the peer? Outline a possible approach. 9

10 Stage 3: A Broadcast UID Resolution Protocol (BURP) In short: 1. Extend the control packet format to include a TTL field. 2. Implement Broadcast UID Resolution so that the peer application no longer relies on the nameserver for UID to IP lookups. This stage of the project replaces the primitive control message protocol of Stage 2 which queried directly connected hosts and the nameserver with a more sophisticated broadcast based UID discovery protocol. Extend the data structure that you have used to store UIDs to sockets. Add a hostnameip entry so that we know what computer the peer is running on. This creates a more complete lookup database for UID information in the peers. LRQ packets need to be given a time to live (TTL) in hops and sent out to all peers to whom we have a direct connection using a broadcast flood method. These packets are forwarded until they die, while the originator waits for a positive response packet (RSP) that contains the host IP address required. If this technique fails (timeout on RSP packet) the host is considered unreachable and message delivery failure is reported to the user. You should not look up the host name in the nameserver tables. The nameserver is only to be used at startup to create a connection to two other hosts which are chosen at random from the nameserver. To obtain two IP addresses from the nameserver you should connect to it and send a packet with the type field set to PRQ. The PRP packet that is sent in response contains two IP addresses in the payload. In solving this problem you should assume that a host that receives a LRQ packet creates a direct TCP connection to the originator. It sends the RSP packet over that link, and retains the link for further communication with the originating peer. The peer that originated the LRQ packet can use then use this connection to send the message to the required destination UID. Testing As in stage 2 you should begin by testing that your peer code can communicate properly with copies of itself with different UID s on several different computers. Test the initial connection establishment algorithm using the central nameserver running on rama.it.uu.se. Now try to exchange messages with peer implementations written by your classmates, you should also test their implementations of the command protocol by asking them to broadcast lookups of UIDs for you. 10

11 Questions Answer the following questions related to the solution to stage 3. Each question should be answered using no more than 250 words to explain your reasoning. 1. What changes do you need to make to the standard packet format to handle the new protocol functions? Draw a picture of the new packet format you have defined. 2. What should a peer do when it receives a LRQ message, and has no information on the UID in its local database? Should it forward the request to the other peers that it has contact with? Comment briefly on the advantages and disadvantages of forwarding requests in this way. 3. The ability to respond correctly to broadcast lookup requests relies on a generally agreed protocol implementation. Has a standard emerged within your class, or have people adopted proprietary solutions? 11

12 3 Hand-in Instructions To pass the assignment you need to provide the complete source code for the stages you are supposed to solve as well the answers to the questions. It is important that you follow the steps below: 1. Your source tree should contain the files peer1.c, peer2.c, etc. corresponding to each of the stages that you have done. They should automatically compile into their corresponding executable file by a make from the top directory p2p/. 2. Create a tar ball with the complete source tree as shown in figure 1. Name the tar ball p2p-{username}.tar.gz. Example: > tar zcvf p2p-krmo5621.tar.gz p2p/ 3. Fill in the form at the back of this compendium. Do not forget to provide a path to the source code in your home directory. Also make sure that the tar ball has the right permissions, i.e. it must be readable by others. 4. Hand in the form and a printed copy of your answers to the questions at a location instructed by your examiner. If you do not follow these instructions your assignment will automatically be handed back to you without corrections. 4 Marking Guidelines Laboratory results are allocated according to the following qualitative guidelines. Godkänd G Your code functions correctly and you have answered all the related questions in a satisfactory manner. Komplettering K The code or questions need further work in order to address shortcomings or implementation bugs revealed during the tests associated with marking Underkänd U Code and/or questions have not been answered to the satisfaction of the marker, and the time limit (generally one year from the date when the work was due) for handing in material has expired. 12

13 Peer to Peer Instant Messaging Name(s): Login Name: Course/Study program: Path to code: Date: Signature: 1

Peer to Peer Instant Messaging

Peer to Peer Instant Messaging Peer to Peer Instant Messaging Assignment in Computer Networks I, Department of Information Technology, Uppsala University. Overview In this assignment you will implement an instant messaging system that

More information

On Distributed Communications, Rand Report RM-3420-PR, Paul Baran, August 1964

On Distributed Communications, Rand Report RM-3420-PR, Paul Baran, August 1964 The requirements for a future all-digital-data distributed network which provides common user service for a wide range of users having different requirements is considered. The use of a standard format

More information

Internet Protocols (chapter 18)

Internet Protocols (chapter 18) Internet Protocols (chapter 18) CSE 3213 Fall 2011 Internetworking Terms 1 TCP/IP Concepts Connectionless Operation Internetworking involves connectionless operation at the level of the Internet Protocol

More information

ETSF05/ETSF10 Internet Protocols Network Layer Protocols

ETSF05/ETSF10 Internet Protocols Network Layer Protocols ETSF05/ETSF10 Internet Protocols Network Layer Protocols 2016 Jens Andersson Agenda Internetworking IPv4/IPv6 Framentation/Reassembly ICMPv4/ICMPv6 IPv4 to IPv6 transition VPN/Ipsec NAT (Network Address

More information

Different Layers Lecture 20

Different Layers Lecture 20 Different Layers Lecture 20 10/15/2003 Jian Ren 1 The Network Layer 10/15/2003 Jian Ren 2 Network Layer Functions Transport packet from sending to receiving hosts Network layer protocols in every host,

More information

ET4254 Communications and Networking 1

ET4254 Communications and Networking 1 Topic 9 Internet Protocols Aims:- basic protocol functions internetworking principles connectionless internetworking IP IPv6 IPSec 1 Protocol Functions have a small set of functions that form basis of

More information

Introduction to Internetworking

Introduction to Internetworking Introduction to Internetworking Introductory terms Communications Network Facility that provides data transfer services An internet Collection of communications networks interconnected by bridges and/or

More information

CHAPTER 22 DISTRIBUTED APPLICATIONS ANSWERS TO QUESTIONS ANSWERS TO PROBLEMS

CHAPTER 22 DISTRIBUTED APPLICATIONS ANSWERS TO QUESTIONS ANSWERS TO PROBLEMS CHAPTER 22 DISTRIBUTED APPLICATIONS ANSWERS TO QUESTIONS 22.1 RFC 821 defines SMTP which is the protocol for exchanging email messages. RFC 822 describes the format of those messages. 22.2 The Simple Mail

More information

Introduction to computer networking

Introduction to computer networking Introduction to computer networking First part of the assignment Academic year 2017-2018 Abstract In this assignment, students will have to implement a client-server application using Java Sockets. The

More information

CS 457 Lecture 11 More IP Networking. Fall 2011

CS 457 Lecture 11 More IP Networking. Fall 2011 CS 457 Lecture 11 More IP Networking Fall 2011 IP datagram format IP protocol version number header length (bytes) type of data max number remaining hops (decremented at each router) upper layer protocol

More information

Internetwork Protocols

Internetwork Protocols Internetwork Protocols Background to IP IP, and related protocols Internetworking Terms (1) Communications Network Facility that provides data transfer service An internet Collection of communications

More information

CPSC 826 Internetworking. The Network Layer: Routing & Addressing Outline. The Network Layer

CPSC 826 Internetworking. The Network Layer: Routing & Addressing Outline. The Network Layer 1 CPSC 826 Intering The Network Layer: Routing & Addressing Outline The Network Layer Michele Weigle Department of Computer Science Clemson University mweigle@cs.clemson.edu November 10, 2004 Network layer

More information

Examination 2D1392 Protocols and Principles of the Internet 2G1305 Internetworking 2G1507 Kommunikationssystem, fk SOLUTIONS

Examination 2D1392 Protocols and Principles of the Internet 2G1305 Internetworking 2G1507 Kommunikationssystem, fk SOLUTIONS Examination 2D1392 Protocols and Principles of the Internet 2G1305 Internetworking 2G1507 Kommunikationssystem, fk Date: January 17 th 2006 at 14:00 18:00 SOLUTIONS 1. General (5p) a) Draw the layered

More information

ICS 451: Today's plan

ICS 451: Today's plan ICS 451: Today's plan ICMP ping traceroute ARP DHCP summary of IP processing ICMP Internet Control Message Protocol, 2 functions: error reporting (never sent in response to ICMP error packets) network

More information

Lecture 10: Protocol Design

Lecture 10: Protocol Design Lecture 10: Protocol Design Prof. Shervin Shirmohammadi SITE, University of Ottawa Fall 2005 CEG 4183 10-1 Introduction TCP and UDP are generic protocols: They fulfill the needs of a wide range of applications

More information

Router Architecture Overview

Router Architecture Overview Chapter 4: r Introduction (forwarding and routing) r Review of queueing theory r Router design and operation r IP: Internet Protocol m IPv4 (datagram format, addressing, ICMP, NAT) m Ipv6 r Generalized

More information

CS454/654 Midterm Exam Fall 2004

CS454/654 Midterm Exam Fall 2004 CS454/654 Midterm Exam Fall 2004 (3 November 2004) Question 1: Distributed System Models (18 pts) (a) [4 pts] Explain two benefits of middleware to distributed system programmers, providing an example

More information

Internet Control Message Protocol (ICMP)

Internet Control Message Protocol (ICMP) Internet Control Message Protocol (ICMP) 1 Overview The IP (Internet Protocol) relies on several other protocols to perform necessary control and routing functions: Control functions (ICMP) Multicast signaling

More information

Computer Science 461 Midterm Exam March 14, :00-10:50am

Computer Science 461 Midterm Exam March 14, :00-10:50am NAME: Login name: Computer Science 461 Midterm Exam March 14, 2012 10:00-10:50am This test has seven (7) questions, each worth ten points. Put your name on every page, and write out and sign the Honor

More information

Genie Snoop lab. Laboration in data communication GenieLab Department of Information Technology, Uppsala University

Genie Snoop lab. Laboration in data communication GenieLab Department of Information Technology, Uppsala University Genie Snoop lab Laboration in data communication GenieLab Department of Information Technology, Uppsala University Overview This lab deals with network layers, services and HTTP transactions as well as

More information

Date: June 4 th a t 1 4:00 1 7:00

Date: June 4 th a t 1 4:00 1 7:00 Kommunika tionssyste m FK, Examina tion G 5 0 7 Date: June 4 th 0 0 3 a t 4:00 7:00 KTH/IMIT/LCN No help material is allowed. You may answer questions in English or Swedish. Please answer each question

More information

MIDTERM EXAMINATION #2 OPERATING SYSTEM CONCEPTS U N I V E R S I T Y O F W I N D S O R S C H O O L O F C O M P U T E R S C I E N C E

MIDTERM EXAMINATION #2 OPERATING SYSTEM CONCEPTS U N I V E R S I T Y O F W I N D S O R S C H O O L O F C O M P U T E R S C I E N C E MIDTERM EXAMINATION #2 OPERATING SYSTEM CONCEPTS 03-60-367-01 U N I V E R S I T Y O F W I N D S O R S C H O O L O F C O M P U T E R S C I E N C E Intersession 2008 Last Name: First Name: Student ID: PLEASE

More information

Unit 5: Internet Protocols skong@itt-tech.edutech.edu Internet Protocols She occupied herself with studying a map on the opposite wall because she knew she would have to change trains at some point. Tottenham

More information

Network layer: Overview. Network layer functions IP Routing and forwarding NAT ARP IPv6 Routing

Network layer: Overview. Network layer functions IP Routing and forwarding NAT ARP IPv6 Routing Network layer: Overview Network layer functions IP Routing and forwarding NAT ARP IPv6 Routing 1 Network Layer Functions Transport packet from sending to receiving hosts Network layer protocols in every

More information

Networking: Network layer

Networking: Network layer control Networking: Network layer Comp Sci 3600 Security Outline control 1 2 control 3 4 5 Network layer control Outline control 1 2 control 3 4 5 Network layer purpose: control Role of the network layer

More information

Network layer: Overview. Network Layer Functions

Network layer: Overview. Network Layer Functions Network layer: Overview Network layer functions IP Routing and forwarding NAT ARP IPv6 Routing 1 Network Layer Functions Transport packet from sending to receiving hosts Network layer protocols in every

More information

Basic Reliable Transport Protocols

Basic Reliable Transport Protocols Basic Reliable Transport Protocols Do not be alarmed by the length of this guide. There are a lot of pictures. You ve seen in lecture that most of the networks we re dealing with are best-effort : they

More information

Communication Networks ( ) / Fall 2013 The Blavatnik School of Computer Science, Tel-Aviv University. Allon Wagner

Communication Networks ( ) / Fall 2013 The Blavatnik School of Computer Science, Tel-Aviv University. Allon Wagner Communication Networks (0368-3030) / Fall 2013 The Blavatnik School of Computer Science, Tel-Aviv University Allon Wagner Kurose & Ross, Chapter 4 (5 th ed.) Many slides adapted from: J. Kurose & K. Ross

More information

Sections Describing Standard Software Features

Sections Describing Standard Software Features 30 CHAPTER This chapter describes how to configure quality of service (QoS) by using automatic-qos (auto-qos) commands or by using standard QoS commands. With QoS, you can give preferential treatment to

More information

MODELS OF DISTRIBUTED SYSTEMS

MODELS OF DISTRIBUTED SYSTEMS Distributed Systems Fö 2/3-1 Distributed Systems Fö 2/3-2 MODELS OF DISTRIBUTED SYSTEMS Basic Elements 1. Architectural Models 2. Interaction Models Resources in a distributed system are shared between

More information

SEN366 (SEN374) (Introduction to) Computer Networks

SEN366 (SEN374) (Introduction to) Computer Networks SEN366 (SEN374) (Introduction to) Computer Networks Prof. Dr. Hasan Hüseyin BALIK (12 th Week) The Internet Protocol 12.Outline Principles of Internetworking Internet Protocol Operation Internet Protocol

More information

Computer Networks - Midterm

Computer Networks - Midterm Computer Networks - Midterm October 28, 2016 Duration: 2h15m This is a closed-book exam Please write your answers on these sheets in a readable way, in English or in French You can use extra sheets if

More information

ICMP (Internet Control Message Protocol)

ICMP (Internet Control Message Protocol) ABSTRACT : ICMP stands for internet control message protocol it is a vital protocol of network layer among the seven layers of OSI(open system interconnection). Here we deal with the several situations

More information

Optical Packet Switching

Optical Packet Switching Optical Packet Switching DEISNet Gruppo Reti di Telecomunicazioni http://deisnet.deis.unibo.it WDM Optical Network Legacy Networks Edge Systems WDM Links λ 1 λ 2 λ 3 λ 4 Core Nodes 2 1 Wavelength Routing

More information

Overview. Exercise 0: Implementing a Client. Setup and Preparation

Overview. Exercise 0: Implementing a Client. Setup and Preparation Overview This Lab assignment is similar to the previous one, in that you will be implementing a simple client server protocol. There are several differences, however. This time you will use the SOCK_DGRAM

More information

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

Transport Layer. The transport layer is responsible for the delivery of a message from one process to another. RSManiaol Transport Layer Transport Layer The transport layer is responsible for the delivery of a message from one process to another Types of Data Deliveries Client/Server Paradigm An application program on the

More information

IP - The Internet Protocol. Based on the slides of Dr. Jorg Liebeherr, University of Virginia

IP - The Internet Protocol. Based on the slides of Dr. Jorg Liebeherr, University of Virginia IP - The Internet Protocol Based on the slides of Dr. Jorg Liebeherr, University of Virginia Orientation IP (Internet Protocol) is a Network Layer Protocol. IP: The waist of the hourglass IP is the waist

More information

ICS 351: Networking Protocols

ICS 351: Networking Protocols ICS 351: Networking Protocols IP packet forwarding application layer: DNS, HTTP transport layer: TCP and UDP network layer: IP, ICMP, ARP data-link layer: Ethernet, WiFi 1 Networking concepts each protocol

More information

External Data Representation (XDR)

External Data Representation (XDR) External Data Representation (XDR) Prof. Chuan-Ming Liu Computer Science and Information Engineering National Taipei University of Technology Taipei, TAIWAN NTUT, TAIWAN 1 Introduction This chapter examines

More information

Multi-System Administration Guide

Multi-System Administration Guide www.novell.com/documentation Multi-System Administration Guide GroupWise 8 August 31, 2009 Legal Notices Novell, Inc. makes no representations or warranties with respect to the contents or use of this

More information

ELEC / COMP 177 Fall Some slides from Kurose and Ross, Computer Networking, 5 th Edition

ELEC / COMP 177 Fall Some slides from Kurose and Ross, Computer Networking, 5 th Edition ELEC / COMP 177 Fall 2016 Some slides from Kurose and Ross, Computer Networking, 5 th Edition Presentation 2 Security/Privacy Presentations Nov 3 rd, Nov 10 th, Nov 15 th Upload slides to Canvas by midnight

More information

Figure 1: Graphical representation of a client-server application

Figure 1: Graphical representation of a client-server application CS/EE 145a : Networking Lab #1 http://www.its.caltech.edu/ eecs145/ Due: October 24, 2007 1 Introduction The development of network-based software has been around for many years. Since its conception,

More information

Network Layer: Internet Protocol

Network Layer: Internet Protocol Network Layer: Internet Protocol Motivation Heterogeneity Scale Intering IP is the glue that connects heterogeneous s giving the illusion of a homogenous one. Salient Features Each host is identified by

More information

Overview. Exercise 0: Implementing a Client. Setup and Preparation

Overview. Exercise 0: Implementing a Client. Setup and Preparation Overview This Lab assignment is similar to the previous one, in that you will be implementing a simple clientserver protocol. There are several differences, however. This time you will use the SOCK_DGRAM

More information

CSCI 4210 Operating Systems CSCI 6140 Computer Operating Systems Homework 4 (document version 1.0) Network Programming using C

CSCI 4210 Operating Systems CSCI 6140 Computer Operating Systems Homework 4 (document version 1.0) Network Programming using C CSCI 4210 Operating Systems CSCI 6140 Computer Operating Systems Homework 4 (document version 1.0) Network Programming using C Overview This homework is due by 11:59:59 PM on Thursday, April 26, 2018.

More information

TCP/IP protocol suite

TCP/IP protocol suite TCP/IP protocol suite The TCP/IP protocol suite was developed prior to the OSI model. Therefore, the layers in the TCP/IP protocol suite do not match exactly with those in the OSI model. The original TCP/IP

More information

CNT5505 Programming Assignment No. 4: Internet Packet Analyzer (This is an individual assignment. It must be implemented in C++ or C)

CNT5505 Programming Assignment No. 4: Internet Packet Analyzer (This is an individual assignment. It must be implemented in C++ or C) . CNT5505 Programming Assignment No. 4: Internet Packet Analyzer (This is an individual assignment. It must be implemented in C++ or C) PURPOSE Experience with packet analyzing and Internet packet formats.

More information

Operation Manual IP Addressing and IP Performance H3C S5500-SI Series Ethernet Switches. Table of Contents

Operation Manual IP Addressing and IP Performance H3C S5500-SI Series Ethernet Switches. Table of Contents Table of Contents Table of Contents... 1-1 1.1 IP Addressing Overview... 1-1 1.1.1 IP Address Classes... 1-1 1.1.2 Special Case IP Addresses... 1-2 1.1.3 Subnetting and Masking... 1-2 1.2 Configuring IP

More information

CSMC 412. Computer Networks Prof. Ashok K Agrawala Ashok Agrawala Set 2. September 15 CMSC417 Set 2 1

CSMC 412. Computer Networks Prof. Ashok K Agrawala Ashok Agrawala Set 2. September 15 CMSC417 Set 2 1 CSMC 412 Computer Networks Prof. Ashok K Agrawala 2015 Ashok Agrawala Set 2 September 15 CMSC417 Set 2 1 Contents Client-server paradigm End systems Clients and servers Sockets Socket abstraction Socket

More information

This tutorial will help you in understanding IPv4 and its associated terminologies along with appropriate references and examples.

This tutorial will help you in understanding IPv4 and its associated terminologies along with appropriate references and examples. About the Tutorial Internet Protocol version 4 (IPv4) is the fourth version in the development of the Internet Protocol (IP) and the first version of the protocol to be widely deployed. IPv4 is described

More information

Choice 1: audio, a simple audio client server system

Choice 1: audio, a simple audio client server system Choice 1: audio, a simple audio client server system The objective of this practice is to complete the program audiosimple which we have presented in practice 0. The new program, called audio, allows the

More information

Chapter 4: outline. 4.5 routing algorithms link state distance vector hierarchical routing. 4.6 routing in the Internet RIP OSPF BGP

Chapter 4: outline. 4.5 routing algorithms link state distance vector hierarchical routing. 4.6 routing in the Internet RIP OSPF BGP Chapter 4: outline 4.1 introduction 4.2 virtual circuit and datagram networks 4.3 what s inside a router 4.4 IP: Internet Protocol datagram format IPv4 addressing ICMP 4.5 routing algorithms link state

More information

MODELS OF DISTRIBUTED SYSTEMS

MODELS OF DISTRIBUTED SYSTEMS Distributed Systems Fö 2/3-1 Distributed Systems Fö 2/3-2 MODELS OF DISTRIBUTED SYSTEMS Basic Elements 1. Architectural Models 2. Interaction Models Resources in a distributed system are shared between

More information

Chapter 4: Network Layer

Chapter 4: Network Layer Chapter 4: Introduction (forwarding and routing) Review of queueing theory Routing algorithms Link state, Distance Vector Router design and operation IP: Internet Protocol IPv4 (datagram format, addressing,

More information

INF3190 Mandatory Assignment:

INF3190 Mandatory Assignment: INF3190 Mandatory Assignment: Formally: This assignment must be completed individually. The submission must be approved prior to submission of the Home Exam 1. To pass the submission must meet the requirements

More information

Sections Describing Standard Software Features

Sections Describing Standard Software Features 27 CHAPTER This chapter describes how to configure quality of service (QoS) by using automatic-qos (auto-qos) commands or by using standard QoS commands. With QoS, you can give preferential treatment to

More information

Socket Programming Assignment 6: Video Streaming with RTSP and RTP

Socket Programming Assignment 6: Video Streaming with RTSP and RTP Socket Programming Assignment 6: Video Streaming with RTSP and RTP In this lab you will implement a streaming video server and client that communicate using the Real-Time Streaming Protocol (RTSP) and

More information

CIS 505: Software Systems

CIS 505: Software Systems CIS 505: Software Systems Fall 2017 Assignment 3: Chat server Due on November 3rd, 2017, at 10:00pm EDT 1 Overview For this assignment, you will implement a simple replicated chat server that uses multicast

More information

P2P Programming Assignment

P2P Programming Assignment P2P Programming Assignment Overview This project is to implement a Peer-to-Peer (P2P) networking project similar to a simplified Napster. You will provide a centralized server to handle cataloging the

More information

CS11 C++ DGC. Spring Lecture 6

CS11 C++ DGC. Spring Lecture 6 CS11 C++ DGC Spring 2006-2007 Lecture 6 The Spread Toolkit A high performance, open source messaging service Provides message-based communication Point-to-point messaging Group communication (aka broadcast

More information

Chapter 11. User Datagram Protocol (UDP)

Chapter 11. User Datagram Protocol (UDP) Chapter 11 User Datagram Protocol (UDP) Outline Process-to-process communication User datagram Checksum UDP operation Use of UDP UDP package Figure 11-1 Position of UDP in the TCP/IP Protocol Suite The

More information

User Datagram Protocol

User Datagram Protocol Topics Transport Layer TCP s three-way handshake TCP s connection termination sequence TCP s TIME_WAIT state TCP and UDP buffering by the socket layer 2 Introduction UDP is a simple, unreliable datagram

More information

The Network Layer Forwarding Tables and Switching Fabric

The Network Layer Forwarding Tables and Switching Fabric The Network Layer Forwarding Tables and Switching Fabric Smith College, CSC 249 February 27, 2018 1 Network Layer Overview q Network layer services v v Desired services and tasks Actual services and tasks

More information

Lecture 2-ter. 2. A communication example Managing a HTTP v1.0 connection. Managing a HTTP request. transport session. Step 1 - opening transport

Lecture 2-ter. 2. A communication example Managing a HTTP v1.0 connection. Managing a HTTP request. transport session. Step 1 - opening transport Lecture 2-ter. 2 A communication example Managing a HTTP v1.0 connection Managing a HTTP request User digits URL and press return (or clicks ). What happens (HTTP 1.0): 1. opens a TCP transport session

More information

Module 7 Implementing Multicast

Module 7 Implementing Multicast Module 7 Implementing Multicast Lesson 1 Explaining Multicast Why Multicast? Used when sending same data to multiple receivers Better bandwidth utilization Less host/router processing Used when addresses

More information

Internet Protocol Stack! Principles of Network Applications! Some Network Apps" (and Their Protocols)! Application-Layer Protocols! Our goals:!

Internet Protocol Stack! Principles of Network Applications! Some Network Apps (and Their Protocols)! Application-Layer Protocols! Our goals:! Internet Protocol Stack! Principles of Network Applications! application: supporting network applications!! HTTP,, FTP, etc.! transport: endhost-endhost data transfer!! TCP, UDP! network: routing of datagrams

More information

UDP and TCP. Introduction. So far we have studied some data link layer protocols such as PPP which are responsible for getting data

UDP and TCP. Introduction. So far we have studied some data link layer protocols such as PPP which are responsible for getting data ELEX 4550 : Wide Area Networks 2015 Winter Session UDP and TCP is lecture describes the two most common transport-layer protocols used by IP networks: the User Datagram Protocol (UDP) and the Transmission

More information

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

Concept Questions Demonstrate your knowledge of these concepts by answering the following questions in the space that is provided. 223 Chapter 19 Inter mediate TCP The Transmission Control Protocol/Internet Protocol (TCP/IP) suite of protocols was developed as part of the research that the Defense Advanced Research Projects Agency

More information

Objectives. Chapter 10. Upon completion you will be able to:

Objectives. Chapter 10. Upon completion you will be able to: Chapter 10 Figure 10.1 Position of IGMP in the network layer Objectives Upon completion you will be able to: Know the purpose of IGMP Know the types of IGMP messages Understand how a member joins a group

More information

(ICMP), RFC

(ICMP), RFC Internet et Control o Message Protocol (ICMP), RFC 792 http://icourse.cuc.edu.cn/networkprogramming/ linwei@cuc.edu.cn Nov. 2009 Overview The IP (Internet Protocol) relies on several other protocols to

More information

Transport Layer (TCP/UDP)

Transport Layer (TCP/UDP) Transport Layer (TCP/UDP) Where we are in the Course Moving on up to the Transport Layer! Application Transport Network Link Physical CSE 461 University of Washington 2 Recall Transport layer provides

More information

CS 447 : Networks and Data Communications Programming Assignment #02 Total Points: 150

CS 447 : Networks and Data Communications Programming Assignment #02 Total Points: 150 CS 447 : Networks and Data Communications Programming Assignment #02 Total Points: 150 Assigned Date : Tuesday, October 23, 2018 Due Date : Tuesday, November 06, 2018 @ 12:29:59 p.m. Overview Your second

More information

Chapter 5: Trouble shooting of a network

Chapter 5: Trouble shooting of a network 5 Troubleshooting TCP/IP Fig 5 show trouble shooting a TCP/IP Chapter 5: Trouble shooting of a network Steps 1 First, determines whether your local host is properly configured. Step 2 Next, uses the ping

More information

CS 356: Computer Network Architectures. Lecture 10: IP Fragmentation, ARP, and ICMP. Xiaowei Yang

CS 356: Computer Network Architectures. Lecture 10: IP Fragmentation, ARP, and ICMP. Xiaowei Yang CS 356: Computer Network Architectures Lecture 10: IP Fragmentation, ARP, and ICMP Xiaowei Yang xwy@cs.duke.edu Overview Homework 2-dimension parity IP fragmentation ARP ICMP Fragmentation and Reassembly

More information

Lecture 3: Packet Forwarding

Lecture 3: Packet Forwarding Lecture 3: Packet Forwarding CSE 222A: Computer Communication Networks Alex C. Snoeren Thanks: Mike Freedman & Amin Vahdat Lecture 3 Overview Paper reviews Packet Forwarding IP Addressing Subnetting/CIDR

More information

CS-435 spring semester Network Technology & Programming Laboratory. Stefanos Papadakis & Manolis Spanakis

CS-435 spring semester Network Technology & Programming Laboratory. Stefanos Papadakis & Manolis Spanakis CS-435 spring semester 2016 Network Technology & Programming Laboratory University of Crete Computer Science Department Stefanos Papadakis & Manolis Spanakis CS-435 Lecture #4 preview ICMP ARP DHCP NAT

More information

IPv6. IPv4 & IPv6 Header Comparison. Types of IPv6 Addresses. IPv6 Address Scope. IPv6 Header. IPv4 Header. Link-Local

IPv6. IPv4 & IPv6 Header Comparison. Types of IPv6 Addresses. IPv6 Address Scope. IPv6 Header. IPv4 Header. Link-Local 1 v4 & v6 Header Comparison v6 Ver Time to Live v4 Header IHL Type of Service Identification Protocol Flags Source Address Destination Address Total Length Fragment Offset Header Checksum Ver Traffic Class

More information

ELEC / COMP 177 Fall Some slides from Kurose and Ross, Computer Networking, 5 th Edition

ELEC / COMP 177 Fall Some slides from Kurose and Ross, Computer Networking, 5 th Edition ELEC / COMP 177 Fall 2014 Some slides from Kurose and Ross, Computer Networking, 5 th Edition Project #1 Starts in one week Is your Linux environment all ready? Bring your laptop Work time after quick

More information

Contents. Configuring GRE 1

Contents. Configuring GRE 1 Contents Configuring GRE 1 Overview 1 GRE encapsulation format 1 GRE tunnel operating principle 1 GRE security mechanisms 2 GRE application scenarios 2 Protocols and standards 4 Configuring a GRE/IPv4

More information

Distributed Systems Inter-Process Communication (IPC) in distributed systems

Distributed Systems Inter-Process Communication (IPC) in distributed systems Distributed Systems Inter-Process Communication (IPC) in distributed systems Mathieu Delalandre University of Tours, Tours city, France mathieu.delalandre@univ-tours.fr 1 Inter-Process Communication in

More information

Question Score 1 / 19 2 / 19 3 / 16 4 / 29 5 / 17 Total / 100

Question Score 1 / 19 2 / 19 3 / 16 4 / 29 5 / 17 Total / 100 NAME: Login name: Computer Science 461 Midterm Exam March 10, 2010 3:00-4:20pm This test has five (5) questions. Put your name on every page, and write out and sign the Honor Code pledge before turning

More information

Request for Comments: 2583 Category: Informational ANL May Guidelines for Next Hop Client (NHC) Developers. Status of this Memo

Request for Comments: 2583 Category: Informational ANL May Guidelines for Next Hop Client (NHC) Developers. Status of this Memo Network Working Group Request for Comments: 2583 Category: Informational R. Carlson ANL L. Winkler ANL May 1999 Status of this Memo Guidelines for Next Hop Client (NHC) Developers This memo provides information

More information

Transport protocols Introduction

Transport protocols Introduction Transport protocols 12.1 Introduction All protocol suites have one or more transport protocols to mask the corresponding application protocols from the service provided by the different types of network

More information

COMPUTER NETWORK. Homework #2. Due Date: April 12, 2017 in class

COMPUTER NETWORK. Homework #2. Due Date: April 12, 2017 in class Computer Network Homework#2 COMPUTER NETWORK Homework #2 Due Date: April 12, 2017 in class Question 1 Suppose a process in Host C has a UDP socket with port number 6789. Suppose both Host A and Host B

More information

Foundations of Python

Foundations of Python Foundations of Python Network Programming The comprehensive guide to building network applications with Python Second Edition Brandon Rhodes John Goerzen Apress Contents Contents at a Glance About the

More information

IPv6 Protocols and Networks Hadassah College Spring 2018 Wireless Dr. Martin Land

IPv6 Protocols and Networks Hadassah College Spring 2018 Wireless Dr. Martin Land IPv6 1 IPv4 & IPv6 Header Comparison IPv4 Header IPv6 Header Ver IHL Type of Service Total Length Ver Traffic Class Flow Label Identification Flags Fragment Offset Payload Length Next Header Hop Limit

More information

Network Layer (4): ICMP

Network Layer (4): ICMP 1 Network Layer (4): ICMP Required reading: Kurose 4.4.3, 4.4.4 CSE 4213, Fall 2006 Instructor: N. Vlajic 2 1. Introduction 2. Network Service Models 3. Architecture 4. Network Layer Protocols in the Internet

More information

ICMP (Internet Control Message Protocol)

ICMP (Internet Control Message Protocol) Today s Lecture ICMP (Internet Control Message Protocol) Internet Protocols CSC / C 573 I. ICMP Overview II. ICMP rror Reporting III. ICMP Query / Response Messages IV. ICMP Message Processing Fall, 2005

More information

Process groups and message ordering

Process groups and message ordering Process groups and message ordering If processes belong to groups, certain algorithms can be used that depend on group properties membership create ( name ), kill ( name ) join ( name, process ), leave

More information

Prof. Shervin Shirmohammadi SITE, University of Ottawa. Internet Protocol (IP) Lecture 2: Prof. Shervin Shirmohammadi CEG

Prof. Shervin Shirmohammadi SITE, University of Ottawa. Internet Protocol (IP) Lecture 2: Prof. Shervin Shirmohammadi CEG Lecture 2: Internet Protocol (IP) Prof. Shervin Shirmohammadi SITE, University of Ottawa Prof. Shervin Shirmohammadi CEG 4185 2-1 Network Layer Provides the upper layers with independence from the data

More information

CS 455/655 Computer Networks Fall Programming Assignment 1: Implementing a Social Media App Due: Thursday, October 5 th, 2017 (1pm)

CS 455/655 Computer Networks Fall Programming Assignment 1: Implementing a Social Media App Due: Thursday, October 5 th, 2017 (1pm) CS 455/655 Computer Networks Fall 2017 Programming Assignment 1: Implementing a Social Media App Due: Thursday, October 5 th, 2017 (1pm) To be completed individually. Please review Academic Honesty noted

More information

Where we are in the Course

Where we are in the Course Network Layer Where we are in the Course Moving on up to the Network Layer! Application Transport Network Link Physical CSE 461 University of Washington 2 Network Layer How to connect different link layer

More information

Design and Implementation of A P2P Cooperative Proxy Cache System

Design and Implementation of A P2P Cooperative Proxy Cache System Design and Implementation of A PP Cooperative Proxy Cache System James Z. Wang Vipul Bhulawala Department of Computer Science Clemson University, Box 40974 Clemson, SC 94-0974, USA +1-84--778 {jzwang,

More information

THE UNIVERSITY OF NEW SOUTH WALES

THE UNIVERSITY OF NEW SOUTH WALES Name of Candidate: Student ID: Signature: THE UNIVERSITY OF NEW SOUTH WALES COMP3331/93331 Computer Networks and Applications Sample Mid-session Examination INSTRUCTIONS TO CANDIDATES: (1) Time allowed:

More information

Internet Layers. Physical Layer. Application. Application. Transport. Transport. Network. Network. Network. Network. Link. Link. Link.

Internet Layers. Physical Layer. Application. Application. Transport. Transport. Network. Network. Network. Network. Link. Link. Link. Internet Layers Application Application Transport Transport Network Network Network Network Link Link Link Link Ethernet Fiber Optics Physical Layer Wi-Fi ARP requests and responses IP: 192.168.1.1 MAC:

More information

Department of Computer Science and Engineering. COSC 4213: Computer Networks II (Fall 2005) Instructor: N. Vlajic Date: November 3, 2005

Department of Computer Science and Engineering. COSC 4213: Computer Networks II (Fall 2005) Instructor: N. Vlajic Date: November 3, 2005 Department of Computer Science and Engineering COSC 4213: Computer Networks II (Fall 2005) Instructor: N. Vlajic Date: November 3, 2005 Midterm Examination Instructions: Examination time: 75 min. Print

More information

Mobile IP and Mobile Transport Protocols

Mobile IP and Mobile Transport Protocols Mobile IP and Mobile Transport Protocols 1 IP routing Preliminaries Works on a hop-by-hop basis using a routing table 32 bits: 129.97.92.42 Address = subnet + host (Mobility No packet for you) Two parts»

More information

Port Mirroring in CounterACT. CounterACT Technical Note

Port Mirroring in CounterACT. CounterACT Technical Note Table of Contents About Port Mirroring and the Packet Engine... 3 Information Based on Specific Protocols... 4 ARP... 4 DHCP... 5 HTTP... 6 NetBIOS... 7 TCP/UDP... 7 Endpoint Lifecycle... 8 Active Endpoint

More information

Outline. SC/CSE 3213 Winter Sebastian Magierowski York University. ICMP ARP DHCP NAT (not a control protocol) L9: Control Protocols

Outline. SC/CSE 3213 Winter Sebastian Magierowski York University. ICMP ARP DHCP NAT (not a control protocol) L9: Control Protocols SC/CSE 3213 Winter 2013 L9: Control Protocols Sebastian Magierowski York University 1 Outline ICMP ARP DHCP NAT (not a control protocol) 2 1 Control Protocols IP is used to transfer data Network layer

More information

CPE 448 Exam #2 (50 pts) April Name Class: 448

CPE 448 Exam #2 (50 pts) April Name Class: 448 Name Class: 448 1) (5 pts) Draw the three way handshake used to establish a TCP connection. Show all SYN and ACK packets. Also show all sequence and acknowledgement numbers associated with the SYN and

More information