Introduction to Information Security Networking 1.

Slides:



Advertisements
Similar presentations
Networked Graphics Building Networked Virtual Environments and Networked Games Distributed Objects, Exchange of Information, Socket Programming.
Advertisements

Sockets. Socket Berkeley Software Distribution Handle-like data structure for communicating A socket is an endpoint  Send and receive  Attach a protocol.
Introduction to Information Security Networking. Transmission Control Protocol (aka TCP) Most widely used protocol A TCP Connection is based on 6 crucial.
Socket Programming Application Programming Interface.
Network Server Programming Expression Evaluation Tutorial #10 CPSC 261.
Sockets Programming CS144 Review Session 1 April 4, 2008 Ben Nham.
Networks: TCP/IP Socket Calls1 Elementary TCP Sockets Chapter 4 UNIX Network Programming Vol. 1, Second Ed. Stevens.
Elementary TCP Sockets Chapter 4 UNIX Network Programming Vol. 1, Second Ed. Stevens.
Quick Overview. 2 ISO/OSI Reference Model Application Application Presentation Presentation Session Session Transport Transport Network Network Data Link.
1 Socket Interfaces Professor Jinhua Guo CIS527 Fall 2003.
1 Pertemuan 10 Non Blocking Matakuliah: H0483 / Network Programming Tahun: 2005 Versi: 1.0.
CS 311 – Lecture 18 Outline IPC via Sockets – Server side socket() bind() accept() listen() – Client side connect() Lecture 181CS Operating Systems.
Winsock programming.  TCP/IP UDP TCP  Winsock #include wsock32.lib.
Introduction to Linux Network 劉德懿
Basic Socket Programming TCP/IP overview. TCP interface Reference: –UNIX Network Programming, by Richard Stevens. –UNIX man page.
Fall 2000Datacom 11 Socket Programming Review Examples: Client and Server-Diagnostics UDP versus TCP Echo.
Fall 2000Datacom 11 Lecture 4 Socket Interface Programming: Service Interface between Applications and TCP.
Zhu Reference: Daniel Spangenberger Computer Networks, Fall 2007 PPT-4 Socket Programming.
CS345 Operating Systems Φροντιστήριο Άσκησης 2. Inter-process communication Exchange data among processes Methods –Signal –Pipe –Sockets.
Computer Network Sritrusta Sukaridhoto. Computer Network – Sritrusta Sukaridhoto Why Computer Network ??? Stand alone Computer …. FOR WHAT ???
Sockets API Overview Sockets with UDP Sockets with TCP Fast Sockets (Fast UDP) IP Multicasting.
Computer Network Sritrusta Sukaridhoto. Why Computer Network ??? Stand alone Computer …. FOR WHAT ???
Ports Port - A 16-bit number that identifies the application process that receives an incoming message. Reserved ports or well-known ports (0 to 1023)
CS 158A1 1.4 Implementing Network Software Phenomenal success of the Internet: – Computer # connected doubled every year since 1981, now approaching 200.
1 Computer Networks An Introduction to Computer Networks University of Tehran Dept. of EE and Computer Engineering By: Dr. Nasser Yazdani Lecture 3: Sockets.
Introduction to Socket
CSS CSS432 Foundation Textbook Ch1 Professor: Munehiro Fukuda.
Sockets Socket = abstraction of the port concept: –Application programs request that the operating system create a socket when one is needed –O.S. returns.
2: Application Layer1 Chapter 2: Application layer r 2.1 Principles of network applications r 2.2 Web and HTTP r 2.3 FTP r 2.4 Electronic Mail  SMTP,
CSCI 330 UNIX and Network Programming Unit XV: Transmission Control Protocol.
Socket address structures Byte ordering IP address conversion
Review: – Why layer architecture? – peer entities – Protocol and service interface – Connection-oriented/connectionless service – Reliable/unreliable service.
Read() recv() connection establishment Server (connection-oriented protocol) blocks until connection from client Client socket() bind() listen() accept()
CSCI 330 UNIX and Network Programming Unit XIV: User Datagram Protocol.
回到第一頁 Client/sever model n Client asks (request) – server provides (response) n Typically: single server - multiple clients n The server does not need.
UNIX Sockets Outline UNIX sockets CS 640.
Carnegie Mellon Proxy & Networking : Introduction to Computer Systems – Recitation H April 11, 2011.
1 TCP Sockets Programming Creating a passive mode (server) socket.Creating a passive mode (server) socket. Establishing an application-level connection.Establishing.
CS 447 Networks and Data Communication Server-Process Organization IP address and SockAddr_In Data Structure Department of Computer Science Southern Illinois.
Lecture 15 Socket Programming CPE 401 / 601 Computer Network Systems slides are modified from Dave Hollinger.
Lecture 3 TCP and UDP Sockets CPE 401 / 601 Computer Network Systems slides are modified from Dave Hollinger.
Socket Programming in C CS587x Lecture 3 Department of Computer Science Iowa State University.
1 Socket Interface. 2 Client-Server Architecture The client is the one who speaks first Typical client-server situations  Client and server on the same.
Socket Programming(1/2). Outline  1. Introduction to Network Programming  2. Network Architecture – Client/Server Model  3. TCP Socket Programming.
1 Socket Interface. 2 Basic Sockets API Review Socket Library TCPUDP IP EthernetPPP ARP DHCP, Mail, WWW, TELNET, FTP... Network cardCom Layer 4 / Transport.
Life, Liberty, and the Pursuit of...Sockets! Athula Balachandran IIT-M, GHC 7609 Wolf Richter UVA, GHC 9127.
Netprog: TCP Sockets1 TCP Sockets Programming Creating a passive mode (server) socket.Creating a passive mode (server) socket. Establishing an application-level.
CS 3700 Networks and Distributed Systems
Jim Fawcett CSE 681 – Software Modeling & Analysis Fall 2002
CS 1652 Jack Lange University of Pittsburgh
Network Architecture Introductory material
Network Programming with Sockets
Server-side Programming CSE 333 Spring 2018
Transport layer API: Socket Programming
CS 3700 Networks and Distributed Systems
شبکه های کامپیوتری پیشرفته
TCP Sockets Programming
Chapter 06. UDP Server/Client.
Server-side Programming CSE 333 Autumn 2018
Server-side Programming CSE 333 Summer 2018
Socket Programming(1/2)
Server-side Programming CSE 333 Winter 2019
Sockets Programming Socket to me!.
Sockets Programming Socket to me!.
Chapter 04. TCP Server/Client.
Socket Programming Neil Tang 09/08/2008
INFORMATION FLOW ACROSS THE INTERNET
Outline Communications in Distributed Systems Socket Programming
Sockets.
Jim Fawcett CSE 681 – Software Modeling & Analysis Summer 2003
Presentation transcript:

Introduction to Information Security Networking 1

DISCLAIMER Networking, in 1 hour. I'll be oversimplifying. 2

The Physical Layer Physical 3

The Data Link Layer HW1 HW2HW3HW4HW5HW6 HW7 Physical Data Link 4

The Network Layer HW1 HW2HW3HW4HW5HW6 HW7 HW1 HW2HW3HW4HW5HW6 HW7 router Physical Data Link Network (IP) My Home WiFi (802.11) Google Ethernet

Special Cases - NATs HW1 HW2HW3HW4HW5HW6 HW7 HW1 HW2HW3HW4HW5HW6 HW7 gateway Physical Data Link Network (IP) My Home WiFi (802.11) Google Ethernet

Special Cases - Localhost HW1 HW2HW3HW4HW5HW6 HW7 HW1 HW2HW3HW4HW5HW6 HW7 gateway Physical Data Link Network (IP) My Home WiFi (802.11) Google Ethernet

The Transport Layer HW1 HW2HW3HW4HW5HW6 HW7 HW1 HW2HW3HW4HW5HW6 HW7 router Physical Data Link Network (IP) My Home WiFi (802.11) Google Ethernet Transport (TCP)

The Rest HW1 HW2HW3HW4HW5HW6 HW7 HW1 HW2HW3HW4HW5HW6 HW7 router Physical Data Link Network (IP) My Home WiFi (802.11) Google Ethernet Transport (TCP) Session Presentation Application OSI Model Physical Application TCP/IP Network (IP) Transport (TCP) HTTP(S) DNS 9

Abstraction ( IP A, port A, IP B, port B ) 10

Sockets Client Server listener = socket.socket() listener.bind((' ', 8000)) listener.listen(5) conn, addr = listener.accept() while True: data = conn.recv(4096) conn.send(data) conn = socket.socket() conn.connect((' ', 8000)) while True: data = input() conn.send(data) print conn.recv(4096) 11

Socket Patterns listener.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) listener.bind(('', 8000)) data = conn.recv(4096) if not data: break 12

Summary The server: Creates a socket Bind it to some IP address and some port Starts listening for connection (allocates a queue with backlog slots) Accepts a connection from the queue and handles it The client: Creates a socket Connects to some IP address and some port Both Send data Receive data 13

And Now In C! int listener, conn, addrlen; struct sockaddr_in listener_addr, conn_addr; char buff[1024]; listener = socket(AF_INET, SOCK_STREAM, 0)); listener_addr.sin_family = AF_INET; listener_addr.sin_port = htons(8000); listener_addr.sin_addr.s_addr = INADDR_ANY; bind(listener, (struct sockaddr*) &listener_addr, sizeof(listener_addr)); listen(listener, 5); addrlen = sizeof(conn_addr); conn = accept(listener, (struct sockaddr*) &conn_addr, &addrlen); while (1) { recv(conn, buff, 1024, 0); send(conn, buff, 1024, 0); } 14

And Now In C! int conn; struct sockaddr_in addr; char buff[1024]; conn = socket(AF_INET, SOCK_STREAM, 0)); addr.sin_family = AF_INET; addr.sin_port = htons(8000); addr.sin_addr.s_addr = inet_addr(" "); connect(conn, (struct sockaddr*) &addr, sizeof(addr)); while (1) { fgets(buff, 1024, stdout); send(conn, buff, 1024, 0); recv(conn, buff, 1024, 0); printf("%s\n", buff); } 15

And Now in netcat ! 16