Network Programming CSE 132. iClicker/WUTexter Question How many of the following statements are true? In the model-view-controller paradigm, a swing.

Slides:



Advertisements
Similar presentations
Socket Programming ENTERPRISE JAVA. 2 Content  Sockets  Streams  Threads  Readings.
Advertisements

Transport Layer3-1 Transport Overview and UDP. Transport Layer3-2 Goals r Understand transport services m Multiplexing and Demultiplexing m Reliable data.
CCNA – Network Fundamentals
CPSC 441: Intro, UDP1 Transport Layer Instructor: Carey Williamson Office: ICT Class Location:
Chapter 3: Transport Layer
Socket Programming.
1 Java Networking – Part I CS , Spring 2008/9.
CSCE 515: Computer Network Programming Chin-Tser Huang University of South Carolina.
Transport Layer3-1 Transport Layer Our goals: r understand principles behind transport layer services: m multiplexing/demultipl exing m reliable data transfer.
Davide Rossi 2002 Using Sockets in Java. 2Davide Rossi 2002 TCP/IP  A protocol is a set of rules that determine how things communicate with each other.
Lecture 8 Chapter 3 Transport Layer
Networking Support In Java Nelson Padua-Perez Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
CPSC 441: Intro, UDP1 Instructor: Anirban Mahanti Office: ICT Class Location: ICT 121 Lectures: MWF 12:00 – 12:50 Notes.
© Lethbridge/Laganière 2001 Chap. 3: Basing Development on Reusable Technology 1 Let’s get started. Let’s start by selecting an architecture from among.
8-1 Transport Layer Our goals: r understand principles behind transport layer services: m multiplexing/demultipl exing m reliable data transfer m flow.
What Is TCP/IP? The large collection of networking protocols and services called TCP/IP denotes far more than the combination of the two key protocols.
Chapter 26 Client Server Interaction Communication across a computer network requires a pair of application programs to cooperate. One application on one.
CEG3185 Tutorial 4 Prepared by Zhenxia Zhang Revised by Jiying Zhao (2015w)
Process-to-Process Delivery:
Greg Jernegan Brandon Simmons. The Beginning…  The problem Huge demand for internet enabled applications and programs that communicate over a network.
1 Transport Layer Computer Networks. 2 Where are we?
CS 352-Socket Programming & Threads Dept. of Computer Science Rutgers University (Thanks,this slides taken from er06/
TCP/IP protocols Communication over Internet is mostly TCP/IP (Transmission Control Protocol over Internet Protocol) TCP/IP "stack" is software which allows.
University of Calgary – CPSC 441.  UDP stands for User Datagram Protocol.  A protocol for the Transport Layer in the protocol Stack.  Alternative to.
Review: –What is AS? –What is the routing algorithm in BGP? –How does it work? –Where is “policy” reflected in BGP (policy based routing)? –Give examples.
Chapter 9.
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.
Introduction to Interprocess communication SE-2811 Dr. Mark L. Hornick 1.
TCP/IP Networking Review Covered Subjects:  Packet Switched Network Structure  Issues of PSNs  Ports & IP Numbers  Delivery Services  Domain Name.
Vassil Roussev 2 A socket is the basic remote communication abstraction provided by the OS to processes. controlled by operating system.
Transport Layer and UDP Tahir Azim Ref:
ICOM 6115©Manuel Rodriguez-Martinez ICOM 6115 – Computer Networks and the WWW Manuel Rodriguez-Martinez, Ph.D. Lecture 26.
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 2.5 Internetworking Chapter 25 (Transport Protocols, UDP and TCP, Protocol Port Numbers)
 TCP (Transport Control Protocol) is a connection-oriented protocol that provides a reliable flow of data between two computers.  TCP/IP Stack Application.
RGEC MEERUT(IWT CS703) 1 Java Networking RGEC Meerut.
Transport Layer1 Ram Dantu (compiled from various text books)
Lecture91 Administrative Things r Return homework # 1 r Review some problems in homework # 1 r Questions about grading? Yona r WebCT for CSE245 is working!
1. I NTRODUCTION TO N ETWORKS Network programming is surprisingly easy in Java ◦ Most of the classes relevant to network programming are in the java.net.
The Transport Layer application transport network data link physical application transport network data link physical application transport network data.
1 Network Programming and Java Sockets. 2 Network Request Result a client, a server, and network Client Server Client machine Server machine Elements.
Networking Terminology: ISP (Internet service provider) – dialup, dsl, cable LAN (local area network) IP (internet protocol) address, eg
ECEN “Internet Protocols and Modeling”, Spring 2012 Course Materials: Papers, Reference Texts: Bertsekas/Gallager, Stuber, Stallings, etc Class.
Transport Layer 3-1 Chapter 3 Outline r 3.1 Transport-layer services r 3.2 Multiplexing and demultiplexing r 3.3 Connectionless transport: UDP.
Chapter 3: Transport Layer Our goals: r understand principles behind transport layer services: m multiplexing/demultipl exing m reliable data transfer.
Socket Programming Introduction. Socket Definition A network socket is one endpoint in a two-way communication flow between two programs running over.
IP addresses IPv4 and IPv6. IP addresses (IP=Internet Protocol) Each computer connected to the Internet must have a unique IP address.
The Client-Server Model And the Socket API. Client-Server (1) The datagram service does not require cooperation between the peer applications but such.
CSI 3125, Preliminaries, page 1 Networking. CSI 3125, Preliminaries, page 2 Networking A network represents interconnection of computers that is capable.
Review: – Why layer architecture? – peer entities – Protocol and service interface – Connection-oriented/connectionless service – Reliable/unreliable service.
MULTIPLEXING/DEMULTIPLEXING, CONNECTIONLESS TRANSPORT.
Prepared by Dr. Jiying Zhao University of Ottawa Canada.
UNIT-6. Basics of Networking TCP/IP Sockets Simple Client Server program Multiple clients Sending file from Server to Client Parallel search server.
Transport Layer3-1 Chapter 3: Transport Layer Our goals: r understand principles behind transport layer services: m multiplexing/demultipl exing m reliable.
Agenda Socket Programming The OSI reference Model The OSI protocol stack Sockets Ports Java classes for sockets Input stream and.
TCP/IP1 Address Resolution Protocol Internet uses IP address to recognize a computer. But IP address needs to be translated to physical address (NIC).
1 Network Communications A Brief Introduction. 2 Network Communications.
Advance Computer Programming Networking Basics – explores the java.net package which provides support for networking. – Also Called “programming for the.
1 K. Salah Application Layer Module K. Salah Network layer duties.
UDP: User Datagram Protocol. What Can IP Do? Deliver datagrams to hosts – The IP address in a datagram header identify a host – treats a computer as an.
IST 201 Chapter 11 Lecture 2. Ports Used by TCP & UDP Keep track of different types of transmissions crossing the network simultaneously. Combination.
Chapter 3 outline 3.1 Transport-layer services
MCA – 405 Elective –I (A) Java Programming & Technology
06- Transport Layer Transport Layer.
Socket Programming Cal Poly Pomona Young CS380.
Transport Layer Our goals:
Process-to-Process Delivery:
Process-to-Process Delivery: UDP, TCP
Transport Layer Our goals:
Presentation transcript:

Network Programming CSE 132

iClicker/WUTexter Question How many of the following statements are true? In the model-view-controller paradigm, a swing JSlider would be considered part of the model. A Java int is stored in 4 bytes. If the least significant bit of a two’s complement number is 1, then the value is negative. A Java double can be read atomically without the protection of a lock A: 0 B: 1 C: 2 D: 3 E: 4

Network Programming vs. Threads Threads Multiple independent execution sequences All on the same computer Utilize common memory for communication Read/write shared objects Network Programming Multiple independent execution sequences Across multiple computers Utilize network for communication Send/receive messages

Internet

Low-level Protocols Internet Protocol (IP) – Datagram transmission – Best effort delivery – Can be reordered Transmission Control Protocol (TCP) – Reliable stream built on IP – Uses sequence numbers for datagram ordering – Retransmits if necessary Combination known as TCP/IP

Addressing on the Internet Internet Protocol (IP) has “unique” ID for each machine on the network (at least in principal) IPv4 uses 32-bit (4-byte) address that is written as follows: a.b.c.d – where a, b, c, and d represent bytes with values between 0 and 255: IPv6 uses 128-bit addresses for greater addressing range

Domain Name Service (DNS) Lookup service for names – Translate domain name into IP address – 

Internet

Sockets Stream abstraction for network communication Once established, use stream wrappers as with file I/O Client (sender) Server (receiver) socket TCP stream

Client Side Socket s = new Socket(“localhost”,10420); // “localhost” is short for this machine, alternative // is to provide IP address or domain name // Second parameter is port # (use 10,000 to 30,000) DataOutputStream dos = new DataOutputStream(s.getOutputStream()); dos.writeInt(4); DataInputStream dis = new DataInputStream(s.getInputStream()); int inpValue = dis.readInt();

ServerSocket

Server Side ServerSocket ss = new ServerSocket(10420); // port while (----) { Socket s = ss.accept(); DataInputStream dis = new DataInputStream(s.getInputStream()); DataOutputStream dos = new DataOutputStream(s.getOutputStream()); while (----) { int inputValue = dis.readInt(); dos.writeInt(inputValue + 1); }

Protocol Design Knock-knock Programmer’s responsibility for common interpretation of bytes at sender and receiver – writeInt() sends 4-byte integer – readInt() receives 4-byte integer – writeByte() send 1 byte – readByte() receives 1 byte Recall dumpster from studio 2 We’ll explore this in studio 6 (next week)

iClicker/WUTexter Question I can invoke writeInt() on what type of object? A.FileOutputStream B.OutputStream C.DataOutputStream D.FileInputStream E.DataInputStream