Review: - PowerPoint PPT Presentation

About This Presentation
Title:

Review:

Description:

What type of service will a typical end user want? Why even considering other types of services ... What is the end point (IP port number) for the server? ... – PowerPoint PPT presentation

Number of Views:22
Avg rating:3.0/5.0
Slides: 13
Provided by: xyu
Learn more at: http://www.cs.fsu.edu
Category:
Tags: end | review

less

Transcript and Presenter's Notes

Title: Review:


1
  • Review
  • Why layer architecture?
  • peer entities
  • Protocol and service interface
  • Connection-oriented/connectionless service
  • Reliable/unreliable service
  • What type of service will a typical end user
    want?
  • Why even considering other types of services
  • layers in the TCP/IP reference model
  • layers in the ISO/OSI reference model

2
Application Layer
  • Problems to be addressed in this layer
  • Directly related to the individual application
    (no common problems)
  • Design issues
  • directly related to each application (no common
    issues).
  • Introduce application layer concepts.
  • Examine the service interface between the
    application layer and the transport layer (socket
    API)
  • Give an example showing how to develop network
    applications.

3
Some network apps
  • E-mail
  • Web
  • Instant messaging
  • Remote login
  • P2P file sharing
  • Multi-user network games
  • Streaming stored video clips
  • Internet telephone
  • Real-time video conference
  • Massive parallel computing

4
Network applications
  • run on different end systems (not routers)
  • communicate over a network.
  • view the network as the abstraction provided by
    the network (the transport layer).
  • Addressing end points
  • End-to end communication

5
  • Service provided by the network
  • Objective to allow processes on different
    machines to talk to each other.
  • Is IP address alone sufficient to address an
    application entity?
  • Network end points
  • IP address port number
  • Why not IP address PID?
  • A process can be associated with an end point.
  • E.g http -- 80, ssh 22, telnet23, DNS 53
  • Service provided by the network end-to-end
    communications
  • Reliable connection-oriented byte stream service
    (TCP)
  • Unreliable connectionless service (UDP)

6
  • From a network application point of view, what is
    the logical topology of the network?
  • A process can bind to an end point and talk to
    anyone else in the network.

7
  • TCP API
  • How to access the end point from a process
  • socket create a new communication end point
  • include ltsys/socket.hgt
  • int socket(int domain, int type, int protocol)
  • domain AF_UNIX file system
  • AF_INET internet
    address
  • type SOCK_STREAM reliable
    connect-oriented, byte stream
  • SOCK_DGRAM unreliable
    connectionless
  • SOCK_SEQPACKET record stream
  • protocol 0, non-zero for a specific protocol
  • bind attach an address to a socket
  • int bind(int socket, const struct sockaddr
    address, size_t address_len)
  • address contains the port number,
    address.sin_port

8
  • Service primitives for TCP
  • listen announce willingness to accept
    connections
  • int listen(int socket, int backlog)
  • backlog number of outstanding connections in the
    listen queue
  • accpet accept a new connection on a socket
  • int accept (int socket, struct sockaddr address,
    size_t address_len)
  • address the address of the connecting socket
  • connect try to establish a connection
  • int connect(int socket, const struct sockaddr
    address, size_t address_len)
  • address the destination address
  • write send data
  • ssize_t write(int fildes, const void buf, size_t
    nbyte)
  • read receive data
  • ssize_t read(int fildes, void buf, size_t
    nbyte)
  • close close a connection
  • int close(int fildes)

9
Server socket bind listen
accept read/write close
Client socket connect read/write
close
What is the end point (IP port number) for the
server? What is the end point (IP port number)
for the client? When is the TCP connection
established?
10
  • One more problem machines may represent numbers
    in different ways.
  • See example3.c on linprog and program.
  • use htons/htonl/ntohl/ntohs routines to solve the
    problem.
  • See example1.c and example2.c.

11
  • TCP
  • Reliable byte stream service.
  • UDP
  • Unreliable datagram service.
  • Data may get lost application may need to deal
    with more details in the communication.

12
  • Basic UDP service interface
  • Socket, bind, sendto, recvfrom, close

UDP server UDP client socket
socket bind
sendto recvfrom recvfrom sendto
close
TCP server TCP client socket
socket Bind
connect Listen Accept
read/write
close Read/write close
Write a Comment
User Comments (0)
About PowerShow.com