Linux Networks - PowerPoint PPT Presentation

About This Presentation
Title:

Linux Networks

Description:

Linux Networks TCP/IP Networking Layers BSD Socket Interface INET Socket Layer Create Bind Listen Accept Connect System Call int sys_socketcall(int ... – PowerPoint PPT presentation

Number of Views:54
Avg rating:3.0/5.0
Slides: 13
Provided by: kims222
Category:
Tags: linux | networks | socket | what

less

Transcript and Presenter's Notes

Title: Linux Networks


1
Linux Networks
  • TCP/IP Networking Layers
  • BSD Socket Interface
  • INET Socket Layer
  • Create
  • Bind
  • Listen
  • Accept
  • Connect

2
Network Applications
User
Kernel
BSD Sockets
Socket Interface
INET Sockets
TCP
UDP
Protocol Layers
IP
ARP
Network Devices
PPP
SLIP
Ethernet
Linux Networking Layers
3
files_struct
count close_on_exec open_fs fd0 fd1 fd255
BSD Socket File Operations
file
f_mode f_pos f_flags f_count f_owner f_op f_inode
f_version
lseek read write select ioctl close fasync
inode
socket
SOCK_STREAM
type protocol data
Address Family socket operations
SOCK_STREAM
sock
type protocol socket
Linux BSD Socket Data Structure
4
System Call
  • ltnet/socket.cgt
  • int sys_socketcall(int call,
    unsigned long args)
  • call
  • ltlinux/net.hgt
  • SYS_SOCKET --gt socket()
  • SYS_BIND --gt bind()
  • ... ...
  • args
  • args

5
family
  • ltinclude/linux/socket.hgt
  • AF_UNIX
  • Unix domain sockets
  • AF_INET
  • Internet IP Protocol
  • AF_IPX
  • Novell IPX
  • AF_APPLETALK
  • Appletalk DDP
  • AF_X25
  • Reserved for X.25 project
  • ... ...

6
type
  • ltinclude/linux/socket.hgt
  • SOCK_STREAM
  • stream (connection) socket
  • SOCK_DGRAM
  • datagram (conn.less) socket
  • SOCK_RAW
  • raw socket
  • SOCK_RDM
  • reliably-delivered message
  • SOCK_SEQPACKET
  • sequential packet socket
  • ... ...

7
protocol
  • ltinclude/linux/in.hgt
  • IPPROTO_IP
  • Dummy protocol for TCP
  • IPPROTO_ICMP
  • Internet Control Message Protocol
  • IPPROTO_IGMP
  • Internet Group Management Protocol
  • IPPROTO_TCP
  • Transmission Control Protocol
  • IPPROTO_EGP
  • Exterior Gateway Protocol
  • ... ...

8
socket(family, type, protocol)
  • ltnet/socket.cgt
  • sys_socket(...)
  • get an empty inode for socket structure
  • allocate a sock structure
  • return the file descriptor of the socket if
    success

9
bind(fd, uaddr, addrlen)
  • ltnet/socket.cgt
  • sys_bind(...)
  • bind a name to a socket
  • move the socket address to kernel space
  • address port checking

10
listen(fd, backlog)
  • ltnet/socket.cgt
  • sys_listen(...)
  • allow the protocol to do anything necessary
  • move a socket into listening state

11
accept(fd, sockaddr, skaddrlen)
  • ltnet/socket.cgt
  • sys_accept(...)
  • attempt to create a new socket
  • set up the link with the client
  • wake up the client
  • return the new fd

12
connect(fd, uaddr, addrlen)
  • ltnet/socket.cgt
  • sys_connect(...)
  • attempt to connect to a socket with the server
    address
  • move the address to kernel space
Write a Comment
User Comments (0)
About PowerShow.com