TA: Donghyun (David) Kim

Slides:



Advertisements
Similar presentations
COEN 445 Communication Networks and Protocols Lab 4
Advertisements

CHATROOM PROJECT Supervised by DAN WITZNER HANSEN Group Members ESWAR EMMADI SURESH KUMAR DONTHA.
A CHAT CLIENT-SERVER MODULE IN JAVA BY MAHTAB M HUSSAIN MAYANK MOHAN ISE 582 FALL 2003 PROJECT.
1 Java Networking – Part I CS , Spring 2008/9.
Page: 1 Director 1.0 TECHNION Department of Computer Science The Computer Communication Lab (236340) Summer 2002 Submitted by: David Schwartz Idan Zak.
McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Application Layer PART VI.
P2P Project Mark Kurman Nir Zur Danny Avigdor. Introduction ► Motivation:  Firewalls may allow TCP or UDP connections on several specific ports and block.
VSP Video Station Protocol Presented by : Mittelman Dana Ben-Hamo Revital Ariel Tal Instructor : Sela Guy Presented by : Mittelman Dana Ben-Hamo Revital.
Chat Room Project (IM- E2003) Supervised by : Dan Witzner Hansen Group Member: Xijie Lu Vu Pham To IT University of Copenhagen 23rd Jan.2004.
Julia Ljunbjörk and Anita Mugenyi. What is a socket? Like a house Between the layers.
Chapter 26 Client Server Interaction Communication across a computer network requires a pair of application programs to cooperate. One application on one.
19-Aug-15 About the Chat program. 2 Constraints You can't have two programs (or two copies of the same program) listen to the same port on the same machine.
Server Design Discuss Design issues for Servers Review Server Creation in Linux.
Assignment 3 A Client/Server Application: Chatroom.
Elementary TCP Sockets
1 Chapter Client-Server Interaction. 2 Functionality  Transport layer and layers below  Basic communication  Reliability  Application layer.
TCP/IP: Basics1 User Datagram Protocol (UDP) Another protocol at transport layer is UDP. It is Connectionless protocol i.e. no need to establish & terminate.
Transport Layer Layer #4 (OSI-RM). Transport Layer Main function of OSI Transport layer: Accept data from the Application layer and prepare it for addressing.
Server Sockets: A server socket listens on a given port Many different clients may be connecting to that port Ideally, you would like a separate file descriptor.
Operating Systems Recitation 9, May 19-20, Iterative server Handle one connection request at a time. Connection requests stored in queue associated.
School of Engineering and Computer Science Victoria University of Wellington Copyright: Peter Andreae david streader, VUW Echo Networking COMP
ICOM 6115©Manuel Rodriguez-Martinez ICOM 6115 – Computer Networks and the WWW Manuel Rodriguez-Martinez, Ph.D. Lecture 26.
Dr. John P. Abraham Professor University of Texas Pan American Internet Applications and Network Programming.
Chapter 2 Applications and Layered Architectures Sockets.
© Lethbridge/Laganière 2005 Chap. 3: Basing Development on Reusable Technology The Client-Server Architecture A distributed system is a system in.
ECEN “Internet Protocols and Modeling”, Spring 2012 Course Materials: Papers, Reference Texts: Bertsekas/Gallager, Stuber, Stallings, etc Class.
Chapter 27 Socket API Interface The interface between an application program and the communication protocols in an operating system is known as the Application.
1 Client-Server Interaction. 2 Functionality Transport layer and layers below –Basic communication –Reliability Application layer –Abstractions Files.
Client/Server Socket Programming Project
Socket Programming.
©The McGraw-Hill Companies, Inc., 2000© Adapted for use at JMU by Mohamed Aboutabl, 2003Mohamed Aboutabl1 1 Chapter 16 Socket Interface.
Netprog: Client/Server Issues1 Issues in Client/Server Programming Refs: Chapter 27.
Java Networking I IS Outline  Quiz #3  Network architecture  Protocols  Sockets  Server Sockets  Multi-threaded Servers.
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.
1 K. Salah Application Layer Module K. Salah Network layer duties.
CS470 Programming Assignment 1 Zilong Ye. A Chat Application Goal: learn socket programming and implement a chat application for exchanging messages between.
CLIENT (Browser) socket accept C1 C2 recv C2 recv send C2 send end_thread recv C3 send bind connect Web Server Proxy recv close C3 close C2 end_thread.
SOCKET PROGRAMMING Presented By : Divya Sharma.
1 Issues in Client/Server Refs: Chapter 27 Case Studies RFCs.
Network security Presentation AFZAAL AHMAD ABDUL RAZAQ AHMAD SHAKIR MUHAMMD ADNAN WEB SECURITY, THREADS & SSL.
COMP2322 Lab 4 Socket Programming
Internet Socket Programing
Introduction To Application Layer
Assignment 3 A Client/Server Application: Chatroom
Echo Networking COMP
Client-Server Model and Sockets
CSC410: Distributed System
Networking COMP
Chapter 3 Internet Applications and Network Programming
Networks and Client/Server Applications
Socket Programming Cal Poly Pomona Young CS380.
CH5 TCP Client - Server Example:
CHAPTER 8 ELEMENTARY UDP SOCKETS
Client/Server Example
Client-Server Interaction
Interacting With Protocol Software
The Transport Layer Socket Programming
The Internet and HTTP and DNS Examples
Implementation CAN Communication Engine
The Client Server Model
Process-to-Process Delivery:
Time Gathering Systems Secure Data Collection for IBM System i Server
Starting TCP Connection – A High Level View
Software Engineering for Internet Applications
Issues in Client/Server Programming
CSC Advanced Unix Programming, Fall 2015
CPEG514 Advanced Computer Networkst
Process-to-Process Delivery: UDP, TCP
Exceptions and networking
Presentation transcript:

TA: Donghyun (David) Kim Homework 1 Review TA: Donghyun (David) Kim

Overall Architecture Hybrid Peer-to-Peer System Server Client1 Client2

Server Description Server responsibility Maintain the list of online-clients Server IP (IP-S) and Port Number (PORT-S) is known Get IP-S in running time Get PORT-S from input arguments Prepare a data structure to maintain a list of client information Client ID (ID-C), Client IP (IP-C), and Client Port Number (PORT-C)

Server Description – cont’ (IP-S, PORT-S) Server ID-C IP-C PORT-C 1 192.168.1.2 6000 2 192.168.1.5 UDP

Server Description – cont’ Waiting for messages from clients via UDP JOIN, ID-C, IP-C, PORT-C LEAVE, ID Assume no two messages arrives at the same time When membership is changed, send the updated list to the all of online-clients via UDP In practice, only change can be sent i.e. forward Join/leave message from a client to the other clients

Server Description – cont’ (IP-S, PORT-S) Server ID-C IP-C PORT-C 1 192.168.1.2 6000 2 192.168.1.5 UDP JOIN/LEAVE UPDATE on-line client list of

Client Architecture It is a peer (Client + Server) Four user input arguments Client ID (ID-C), Port number of the client (PORT-C) ID-S, PORT-S Learn its own IP (IP-C) Two global variables Thread1 and Thread2 should share one Boolean flag which define their actions MODE: 1 or 2 A socket descriptor for the user to communicate with another client SOCKET: -1 (disconnected) or other value Assume no racing condition

Client Architecture – cont’ 3 major threads (running at the same time) Thread1 Mode1: Handling user input and connecting to another client via TCP Mode2: Handling user input when connected Thread2 Mode1: Listening a connection request from another via TCP Mode2: Still, listening a connection request from another via TCP, but reject all other requests. Thread3 Send a JOIN message to the with (ID-C, IP-C, PORT-C) Listening a membership update from the server via UDP

Client Architecture – cont’ Thread1 Mode1: Handling user input and connecting to another client via TCP DISPLAY-LIST: display the up-to-date list of online-clients After a session is established, the connection can be terminated by typing “BYE” on any client CONNECT ID-C: try establishing a connect to the client with ID-C TERMINATE: terminate this client Mode2: Handling user input when connected Client Thread1 Thread2 Thread3

Example Server ID-C IP-C PORT-C (IP-S, PORT-S) UDP

Example Server Client1 ID-C IP-C PORT-C (IP-S, PORT-S) UDP MODE: 1, SD: -1 Client1 JOIN (ID-C1, IP-C1, PORT-C1) Thread1 Thread2 TCP Thread3 UDP

Example Server Client1 Client2 ID-C IP-C PORT-C ID-C1 IP-C1 PORT-C1 (IP-S, PORT-S) UDP (IP-S, PORT-S ID-C2, IP-C2, PORT-C2) MODE: 1, SD: -1 MODE: 1, SD: -1 Client1 Client2 LIST{(ID-C1, IP-C1, PORT-C1)} Thread1 Thread1 Thread2 Thread2 TCP TCP Thread3 Thread3 UDP UDP

Example Server Client1 Client2 ID-C IP-C PORT-C ID-C1 IP-C1 PORT-C1 (IP-S, PORT-S) UDP (IP-S, PORT-S ID-C2, IP-C2, PORT-C2) MODE: 1, SD: -1 MODE: 1, SD: -1 Client1 Client2 JOIN (ID-C2, IP-C2, PORT-C2) Thread1 Thread1 Thread2 Thread2 TCP TCP Thread3 Thread3 UDP UDP

Example Server Client1 Client2 ID-C IP-C PORT-C ID-C1 IP-C1 PORT-C1 (IP-S, PORT-S) UDP LIST {(ID-C1, IP-C1, PORT-C1), (ID-C2, IP-C2, PORT-C2)} MODE: 1, SD: -1 MODE: 1, SD: -1 Client1 Client2 Thread1 Thread1 Thread2 Thread2 TCP TCP Thread3 Thread3 UDP UDP

Example Server Client1 Client2 ID-C IP-C PORT-C ID-C1 IP-C1 PORT-C1 (IP-S, PORT-S) UDP MODE: 1, SD: -1 MODE: 2, SD: 5 Client1 Client2 Thread1 CONNECT REQ(ID-C2) Thread1 TCP Thread2 Thread2 TCP TCP Thread3 Thread3 UDP UDP

Example Server Client1 Client2 ID-C IP-C PORT-C ID-C1 IP-C1 PORT-C1 (IP-S, PORT-S) UDP MODE: 2, SD: 3 MODE: 2, SD: 5 Client1 Client2 Thread1 Thread1 TCP TCP Thread2 Thread2 TCP TCP Thread3 Thread3 UDP UDP

Example Server Client1 Client2 ID-C IP-C PORT-C ID-C1 IP-C1 PORT-C1 (IP-S, PORT-S) UDP MODE: 2, SD: 3 MODE: 2, SD: 5 Client1 Client2 BYE Thread1 Thread1 TCP TCP Thread2 Thread2 TCP TCP Thread3 Thread3 UDP UDP

Example Server Client1 Client2 ID-C IP-C PORT-C ID-C1 IP-C1 PORT-C1 (IP-S, PORT-S) UDP MODE: 1, SD: -1 MODE: 1, SD: -1 Client1 Client2 Thread1 Thread1 Thread2 Thread2 TCP TCP Thread3 Thread3 UDP UDP

Example Server Client1 Client2 ID-C IP-C PORT-C ID-C1 IP-C1 PORT-C1 (IP-S, PORT-S) UDP MODE: 1, SD: -1 MODE: 1, SD: -1 LEAVE (ID-C1) Client1 Client2 Thread1 Thread1 Thread2 Thread2 TCP TCP Thread3 Thread3 UDP UDP

Example Server Client2 ID-C IP-C PORT-C ID-C2 IP-C2 PORT-C2 (IP-S, PORT-S) UDP LIST {(ID-C2, IP-C2, PORT-C2)} MODE: 1, SD: -1 Client2 Thread1 Thread2 TCP Thread3 UDP