CS470 Programming Assignment 1 Zilong Ye. A Chat Application Goal: learn socket programming and implement a chat application for exchanging messages between.

Slides:



Advertisements
Similar presentations
CCNA2 Module 4. Discovering and Connecting to Neighbors Enable and disable CDP Use the show cdp neighbors command Determine which neighboring devices.
Advertisements

COEN 445 Communication Networks and Protocols Lab 4
Client-Server Applications. Indirect Top Level Interaction Application.
History DHCP was first defined as a standards track protocol in RFC 1531 in October 1993, as an extension to the Bootstrap Protocol (BOOTP). The motivation.
Socket Programming.
1 CCNA 2 v3.1 Module 4. 2 CCNA 2 Module 4 Learning about Devices.
1 Java Networking – Part I CS , Spring 2008/9.
1 L53 Networking (2). 2 OBJECTIVES In this chapter you will learn:  To understand Java networking with URLs, sockets and datagrams.  To implement Java.
Network Programming CS3250. References Core Java, Vol. II, Chapter 3. Book examples are available from
1 © 2003, Cisco Systems, Inc. All rights reserved. CCNA 1 v3.0 Module 11 TCP/IP Transport and Application Layers.
McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Application Layer PART VI.
A Chat Server DBI – Representation and Management of Data on the Internet.
Networks 1 CS502 Spring 2006 Network Input & Output CS-502 Operating Systems Spring 2006.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved L22 (Chapter 25) Networking.
Introduction to the Application Layer Computer Networks Computer Networks Spring 2012 Spring 2012.
CS-3013 & CS-502, Summer 2006 Network Input & Output1 CS-3013 & CS-502, Summer 2006.
P2P Project Mark Kurman Nir Zur Danny Avigdor. Introduction ► Motivation:  Firewalls may allow TCP or UDP connections on several specific ports and block.
Everything. MACIP End-host IP: MAC: 11:11:11:11:11 gateway IP: MAC: 22:22:22:22:22 Google server IP: MACIP MACInterfaceMACInterface.
Lecture 8 Modeling & Simulation of Communication Networks.
2 $ command Command Line Options ls –a –l hello hi Command Arguments.
Hjemmeeksamen 1 INF3190. Oppgave Develop a monitoring/administration tool which allows an administrator to use a client to monitor all processes running.
NDN NAC Chengyu Fan 1. Motivation Currently, NDN users need manual configuration before they can publish or consume content NDN Auto-configuration (NAC)
? INTERNET WHAT, WHY, HOW. DEFINITION The Internet is a massive public spiderweb of computer connections. It connects personal computers, laptops, tablets,
FTP (File Transfer Protocol) & Telnet
Socket Lab Info. Computer Network. Requirement Use TCP socket to implement a pair of programs, containing a server and a client. The server program shall.
CCNA 1 v3.0 Module 11 TCP/IP Transport and Application Layers.
CS3516 A15 Help Session 1 CS3516 — TCP/IP Socket Programming Presented by Oleksandr Narykov
Introduction to Interprocess communication SE-2811 Dr. Mark L. Hornick 1.
Cisco S2 C4 Router Components. Configure a Router You can configure a router from –from the console terminal (a computer connected to the router –through.
2: Application Layer 1 Chapter 2: Application layer r 2.1 Principles of network applications r 2.2 Web and HTTP r 2.3 FTP r 2.4 Electronic Mail  SMTP,
Vassil Roussev 2 A socket is the basic remote communication abstraction provided by the OS to processes. controlled by operating system.
Establishing communication with Envirobat using TCP/IP Presented by Apourva Parthasarathy Date : 18/06/13.
1 © 2003, Cisco Systems, Inc. All rights reserved. CCNA 1 v3.0 Module 11 TCP/IP Transport and Application Layers.
CCNA 1 v3.0 Module 11 TCP/IP Transport and Application Layers.
Chapter 2 Applications and Layered Architectures Sockets.
Remote Shell CS230 Project #4 Assigned : Due date :
DNS SRV and NAPTR Use for SPEERMINT - Tom Creighton, Gaurav Khandpur Comcast SPEERMINT Intermin Meeting Philadelphia Sept
CS390- Unix Programming Environment CS 390 Unix Programming Environment Java Socket Programming.
ECEN “Internet Protocols and Modeling”, Spring 2012 Course Materials: Papers, Reference Texts: Bertsekas/Gallager, Stuber, Stallings, etc Class.
CS 158A1 1.4 Implementing Network Software Phenomenal success of the Internet: – Computer # connected doubled every year since 1981, now approaching 200.
Position of application layer. Application layer duties.
Presented by Rebecca Meinhold But How Does the Internet Work?
Processes CSCI 4534 Chapter 4. Introduction Early computer systems allowed one program to be executed at a time –The program had complete control of the.
Client/Server Socket Programming Project
Link Layer5-1 Synthesis: a “day” in the life of a web request  journey down protocol stack!  application, transport, network, link  putting-it-all-together:
The Client-Server Model And the Socket API. Client-Server (1) The datagram service does not require cooperation between the peer applications but such.
Part 4: Network Applications Client-server interaction, example applications.
GPRS functionality overview in Horner OCS. GPRS functionality – Peer to Peer communication over GPRS – CSCAPE connectivity over GPRS – Data exchange using.
Socket Programming.
Newsgroup World Wide Web (WWW) Conservation Over the Internet e.g.ICQ File Transfer Protocol (FTP) Includes 6 main services: Electronic Mail Remote.
1 © 2003, Cisco Systems, Inc. All rights reserved. CCNA 2 Module 4 Learning About Other Devices.
1 Tips for the assignment. 2 Socket: a door between application process and end- end-transport protocol (UDP or TCP) TCP service: reliable transfer of.
+ Routing Concepts 1 st semester Objectives  Describe the primary functions and features of a router.  Explain how routers use information.
Socket programming in C. Socket programming Socket API introduced in BSD4.1 UNIX, 1981 explicitly created, used, released by apps client/server paradigm.
A Local Area Network Chat Client ITTC LAN CHAT John Vincent Cecogo Jerikho Daguno Ardee Santos Elaine Mendoza Anjomar Pat Del Mindo Philip John Sales Philip.
End-host IP: MAC: 11:11:11:11:11 gateway IP: MAC: 22:22:22:22:22 Google server IP: interne t interface DNS server IP:
Client-server communication Prof. Wenwen Li School of Geographical Sciences and Urban Planning 5644 Coor Hall
1 K. Salah Application Layer Module K. Salah Network layer duties.
Powerpoint Templates Page 1 Powerpoint Templates CS Networks Laboratory HANDLED BY, A.MAHESH PRIYA L/IT.
SOCKET PROGRAMMING Presented By : Divya Sharma.
COMP2322 Lab 4 Socket Programming
Client-Server Model and Sockets
Socket Programming Cal Poly Pomona Young CS380.
TCP Transport layer Er. Vikram Dhiman LPU.
Chapter 2 Introduction Application Requirements VS. Transport Services
Programming Assignment I
Starting TCP Connection – A High Level View
TA: Donghyun (David) Kim
Computer Networks Protocols
Presentation transcript:

CS470 Programming Assignment 1 Zilong Ye

A Chat Application Goal: learn socket programming and implement a chat application for exchanging messages between remote users; Peer 1 Peer 3 Peer 2 Socket enables this “Hello” “Hi back”

Start the program Name your program as “chat” Specify the port number that the process is running on The process works like a unix shell E.g.: C://course/cs470/./chat 4545 >>

help Show the command manual E.g.: C://course/cs470/./chat 4545 >> help >> myip display IP address connect connect to another peer send send messages to peers …………. exit exit the program >>

myip Show the IP of your laptop E.g.: >> myip >> The IP address is >>

myport Show the port number that the process runs on E.g.: >> myport >> The program runs on port number 4545 >>

connect E.g.: >> connect >> The connection to peer is successfully established; >> Peer 2 displays the connection news and update its list On peer 2, e.g.: >> The connection to peer is successfully established; >>

list List all the connected peers E.g.: >> connect >> The connection to peer 2 is successfully established; >> list id: IP address Port No. 1: : : : >> On peer 2, e.g.: >> list id: IP address Port No. 1: >>

send E.g.: >> list id: IP address Port No. 1: : : : >> send 2 Hello

send Peer 2 receives the message and should display the message >> Message received from : “Hello” >> list id: IP address Port No. 1: >> send 1 Hi, back >> Peer 1 receives the reply and should display the message >> Message received from : “Hi, back” >>

terminate Terminate the connection E.g.: >> list id: IP address Port No. 1: : : : >> terminate 2 >> list id: IP address Port No. 1: : :

terminate Peer 2 displays the termination news and update its connection list >> list id: IP address Port No. 1: >> Peer terminates the connection >> list id: IP address Port No. >>

exit Terminate all the connections and exit the program; The other peers should display the exit news and update their peer list; E.g.: C://course/cs470/./chat 4545 >> help ……. >> list ……. >> exit C://course/cs470/

Useful links Socket Programming: Beej Socket Guide: Select function: ect.3.asp ect.3.asp

How to recognize the command input

Code structure

Fill out addr_info structure

Regular steps for socket programming

How to use connect

myip is your “Lo” IP address, and it is NOT what we want; Create a UDP socket to contact any public DNS server (e.g., or by Google) to get a response from the DNS server and obtain your real IP address

Select based I/O

Select() related functions

Select() example