Dr. John P. Abraham Professor University of Texas Pan American Internet Applications and Network Programming.

Slides:



Advertisements
Similar presentations
TCP/IP MODEL Maninder Kaur
Advertisements

Transport Layer3-1 Transport Overview and UDP. Transport Layer3-2 Goals r Understand transport services m Multiplexing and Demultiplexing m Reliable data.
© 2007 Cisco Systems, Inc. All rights reserved.Cisco Public ITE PC v4.0 Chapter 1 1 OSI Transport Layer Network Fundamentals – Chapter 4.
28.2 Functionality Application Software Provides Applications supply the high-level services that user access, and determine how users perceive the capabilities.
© 2007 Cisco Systems, Inc. All rights reserved.Cisco Public 1 Version 4.0 OSI Transport Layer Network Fundamentals – Chapter 4.
CS335 Networking & Network Administration Tuesday, May 25, 2010.
Chapter 3: Transport Layer
Socket Programming.
1 Java Networking – Part I CS , Spring 2008/9.
1 © 2003, Cisco Systems, Inc. All rights reserved. CCNA 1 v3.0 Module 11 TCP/IP Transport and Application Layers.
Lecture 8 Chapter 3 Transport Layer
McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Application Layer PART VI.
1 School of Computing Science Simon Fraser University CMPT 771/471: Internet Architecture and Protocols Socket Programming Instructor: Dr. Mohamed Hefeeda.
Distributed systems (NET 422) Prepared by Dr. Naglaa Fathi Soliman Princess Nora Bint Abdulrahman University College of computer.
Some slides are in courtesy of J. Kurose and K. Ross Review of Previous Lecture Electronic Mail: SMTP, POP3, IMAP DNS Socket programming with TCP.
1 Computer Networks Transport Layer Protocols. 2 Application-layer Protocols Application-layer protocols –one “piece” of an app –define messages exchanged.
8-1 Transport Layer Our goals: r understand principles behind transport layer services: m multiplexing/demultipl exing m reliable data transfer m flow.
1 Computer Networks and Internets, 5e By Douglas E. Comer Lecture PowerPoints Adapted from the notes By Lami Kaya, © 2009 Pearson Education.
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.
I NTRODUCTION OF S OCKET P ROGRAMMING L.Aseel AlTurki King Saud University.
Gursharan Singh Tatla Transport Layer 16-May
Chapter 26 Client Server Interaction Communication across a computer network requires a pair of application programs to cooperate. One application on one.
Process-to-Process Delivery:
Dr. John P. Abraham Professor University of Texas Pan American Internet Applications and Network Programming.
TCP/IP protocols Communication over Internet is mostly TCP/IP (Transmission Control Protocol over Internet Protocol) TCP/IP "stack" is software which allows.
Chapter 17 Networking Dave Bremer Otago Polytechnic, N.Z. ©2008, Prentice Hall Operating Systems: Internals and Design Principles, 6/E William Stallings.
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.
70-291: MCSE Guide to Managing a Microsoft Windows Server 2003 Network Chapter 3: TCP/IP Architecture.
1 Chapter Client-Server Interaction. 2 Functionality  Transport layer and layers below  Basic communication  Reliability  Application layer.
IP and Errors IP Best Effort Datagrams can be: –Lost –Delayed –Duplicated –Delivered out of order –Corrupted.
 Socket  The combination of an IP address and a port number. (RFC 793 original TCP specification)  The name of the Berkeley-derived application programming.
Jozef Goetz, Application Layer PART VI Jozef Goetz, Position of application layer The application layer enables the user, whether human.
Internet Applications and Network Programming Dr. Abraham Professor UTPA.
ICOM 6115©Manuel Rodriguez-Martinez ICOM 6115 – Computer Networks and the WWW Manuel Rodriguez-Martinez, Ph.D. Lecture 26.
TCP/IP Transport and Application (Topic 6)
RGEC MEERUT(IWT CS703) 1 Java Networking RGEC Meerut.
Fall 2005 By: H. Veisi Computer networks course Olum-fonoon Babol Chapter 6 The Transport Layer.
Transport Layer1 Ram Dantu (compiled from various text books)
CCNA 1 v3.0 Module 11 TCP/IP Transport and Application Layers.
Chapter 2 Applications and Layered Architectures Sockets.
The Socket Interface Chapter 21. Application Program Interface (API) Interface used between application programs and TCP/IP protocols Interface used between.
Position of application layer. Application layer duties.
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.
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.
The Client-Server Model And the Socket API. Client-Server (1) The datagram service does not require cooperation between the peer applications but such.
1 Kyung Hee University Chapter 11 User Datagram Protocol.
1 User Datagram Protocol. 2 Transport Protocols Provide logical communication between application processes running on different hosts Run on end hosts.
UDP: User Datagram Protocol Chapter 12. Introduction Multiple application programs can execute simultaneously on a given computer and can send and receive.
Transport Layer3-1 Chapter 3: Transport Layer Our goals: r understand principles behind transport layer services: m multiplexing/demultipl exing m reliable.
McGraw-Hill Chapter 23 Process-to-Process Delivery: UDP, TCP Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.1 Computer Networks and Internets, 5e By Douglas E. Comer Lecture PowerPoints.
1 Network Communications A Brief Introduction. 2 Network Communications.
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.
Process-to-Process Delivery:
CSEN 404 Transport Layer I Amr El Mougy Lamia Al Badrawy.
Introduction to Networks
Chapter 3 outline 3.1 Transport-layer services
Sockets and Beginning Network Programming
Chapter 3 Internet Applications and Network Programming
MCA – 405 Elective –I (A) Java Programming & Technology
Introduction to Networks
Client-Server Interaction
Process-to-Process Delivery:
Internet Applications and Network Programming
CSCD 330 Network Programming
Internet Applications & Programming
Process-to-Process Delivery: UDP, TCP
Presentation transcript:

Dr. John P. Abraham Professor University of Texas Pan American Internet Applications and Network Programming

Chapter Covers  Paradigm that applications follow when communicating over the internet  Socket application programming interface – Socket API

Two basic Internet Communication Pardigms  Stream oriented  Message Oriented  Differentiate between the two See p 28. fig to 1 vs many to many comm Sequence of individual bytes vs. sequence of packets Arbitrary length vs. max limit to 64k Most applications vs. multimedia Tcp vs. udp

Stream transport in the Internet  Sequence of bytes that flows from one application program to another.  Browser uses the stream service. browser requests to the webserver, which responds by sending the page. Stream mechanism transfers a sequence of bytes without attaching meaning or inserting boundaries. The sending application may send one byte or a block of bytes. Although it delivers all bytes in sequence, the steram paradigm does not guarantee that the chunks of bytes passed to a receiving application correspond to the chunks of bytes transferred by the sending application.

Message Transport in the Internet  The network accepts and delivers messages  The network never delivers part of the message nor joins multiple messages together.  Messages can be 1 to 1, 1 to many, or many to 1 (application on many computers can send messages to a given application).  Messages can be lost, duplicated or delivered out of order. It is up to the programmer to ensure that the application operates correctly.

Connection-oriented communication  Similar to a telephone call.  Establish connection, talk, terminate connection  See algorithm on page 30.

Client Server Model of Interation  How can a pair of applications that run on two different computers coordinate? One application known as the server starts first and awaits contact from any computer. The other application known as the client starts second and initiate the connection. Must know which server to contact. When the client terminates, the server waits for another connection. See figure 3.2 p.30

Characteristics of clients and servers  Client – user invokes, application program through the underlying OS initiates contact with a server  Can access multiple services as needed. Keeps track of various connections through ports.  Server – handles multiple remote sessions simultaneously, therefore needs a powerful machine.  Waits passively for contact from remote clients

Server application model  Server application starts first  Does not need to know which client will contact it  Waits passively and arbitrarily long for contact from a client  Communicates with a client by both sending and receiving data  Stays running after servicing one client, and waits of another. Requires a server class machine. It can accept many connections.

Client application model  Starts after the server has started  Must know which server to contact  Initiate contact and then sends and receives data  May terminate after interacting with the server Any computer can be a client. It can do other tasks such as computation.

Server Identification and Memutliplexing  A client sends request to a server, the server sends response to the client.  The internet protocols divide identification into two parts: an identifier for the computer (IP address) on which the server runs and the identifier for a particular service (protocol port number – 16bits such as 80 for web and 25 for ) on the computer.  The DNS is used to convert the computer name to an IP address.  Server uses threading to accept concurrent requests.

Circular Dependencies Among servers  A server can become a client for a different server (think of 3 tier systems).  Programmers must be careful to avoid circular references.

Network Programming and the Socket API

SOCKETS PRIMER By Dr. John P. Abraham University of Texas Pan American

CLIENT/SERVER  Server side  Client side  Request and Reply  The client and server communicate with each other through something called Berkley socket or winsock  Socket API is a de facto standard for Internet communication

SOCKET APPLICATION PROGRAMMER’S INTERFACE (API) TO THE NETWORK (TRANSPORT LAYER) The socket API is integrated with I/O When an application creates a socket to use for Internet communication, the OS returns a small integer descriptor that identifies the socket The application then passes the descriptor as an argument when it calls functions to perform an operation on the socket

TCP or UDP  THE TRANSPORT PROTOCOL CAN USE EITHER TCP OR UDP  PROGRAMMER NEEDS TO SPECIFY WHICH IS BEING USED

ADDRESSING  An application must specify address of the remote computer, the protocol port number and whether the application will act as a client or server.  SENDER AND RECEIVER MUST KNOW EACH OTHER’S ADDRESS AND PORT. IP ADDRESS OR NAME OF HOSTS PORT NUMBER

Summary of socket functions  See page 37 figure 3.7  This is an important figure  I have given some properties and methods two slides later

PORT NUMBER  THERRE ARE TOTAL PORTS (16 BIT UNSIGNED)  PORTS BELOW 1024 ARE CALLED WELL KNOWN PORTS. YOU SHOULD STAY AWAY FROM THE WELL KNOWN PORTS WHEN YOU WRITE APPLICATIONS UNLESS YOU ARE PROGRAMMING FOR A STANDARD SERVICE.

SOME WELL KNOWN PORTS SERVICEPORT HTTP80 POP3110 SMTP25 TELNET23 FTP21,20 FINGER79 LOCAL LOOPS0

Winsock properties Bytes Received Returns the number (long integer) of bytes currently in the receive buffer. Read-only. LocalHost Name Returns the name of the local host. Read only (Available at run time). Local IPReturns IP assigned to the local machine. You may use the name of the machine. Local PortReturns the local port number. You may set the port number with this property. Long integer. ProtocolEither TCP or UDP. You can set this. Remote PortSet what port the remote program is using.

Winsock Methods AcceptServer accepts requests for connection from the client. The listen must be running. CloseTerminates a connection. Get DataRetrieves current block of data from the buffer places in a variable. Removes from the queue. Peek DataSame as get Data. Does not remove data from the queue. ListenServer side. Waits for a connection from client. Send DataDispatches data to remote computer. ConnectRequests a connection to the remote computer

Socket calls in a client and server  Client Socket  connect  send  rcv (repeat send  rcv)  close  Server Socket  bind  listen  accept  rcv  send (repeat send and rcv)  close  Following are some description about these functions

Read and write with sockets  You can use read and write instead of recv and send with some os.  The only way to learn it is to do some programming

C# (.NET)  The.NET framework provides two namespaces, System.Net and System.Net.Sockets for socket programming.  The communication can be either connection oriented or connectionless. They can also be either stream oriented or data- gram based.  The most widely used protocol TCP is used for stream-based communication and UDP is used for data-grams based applications..

Discovering IP address  System.Net contains the Dns class.  Dns class can be used to query information about various things including the IP addresses  Dns.GetHostByName can be used to return DNS host name of the local machine.