CS2910 Week 3, Class 1 Today What is a protocol? Using TCP in Python Defining methods in Python Long procedure design SE-2811 Slide design: Dr. Mark L.

Slides:



Advertisements
Similar presentations
Introduction 1-1 Chapter 3 Transport Layer Intro and Multiplexing Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley.
Advertisements

Application Layer 2-1 Chapter 2 Application Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012.
COEN 445 Communication Networks and Protocols Lab 4
CPSC 441: Intro, UDP1 Transport Layer Instructor: Carey Williamson Office: ICT Class Location:
Computer Communication Digital Communication in the Modern World Transport Layer Multiplexing, UDP
CPSC 441: Intro, UDP1 Instructor: Anirban Mahanti Office: ICT Class Location: ICT 121 Lectures: MWF 12:00 – 12:50 Notes.
Transport Layer Transport Layer. Transport Layer 3-2 Chapter 3 Transport Layer Computer Networking: A Top Down Approach Featuring the Internet,
TCOM 509 – Internet Protocols (TCP/IP) Lecture 04_a Transport Protocols - UDP Instructor: Dr. Li-Chuan Chen Date: 09/22/2003 Based in part upon slides.
Network LayerII-1 RSC Part III: Transport Layer 1. Basic Concepts Redes y Servicios de Comunicaciones Universidad Carlos III de Madrid These slides are,
Transport Layer 3-1 Chapter 3 Transport Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012 All.
Discussion 2 Sockets Programming Applets TCP UDP HTTP Delay Estimation
Application Layer 2-1 ESERCITAZIONE SOCKET PROGRAMMING.
TCP/IP Transport and Application (Topic 6)
Transport Layer 3-1 Chapter 3 Transport Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012 Part.
Chapter 3 Transport Layer
2: Application Layer1 Chapter 2 Application Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012.
Application Layer 2-1 Chapter 2 Application Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012.
Transport Layer 3-1 Chapter 3 Transport Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012 A.
Transport Layer3-1 Chapter 3 Transport Layer Computer Networking: A Top Down Approach Featuring the Internet, 2 nd edition. Jim Kurose, Keith Ross Addison-Wesley,
SE1011 Week 2, Class 3 Today Compiling and running Another example using Scanner Compile-time and Run-time errors Review for exam SE-1011 Slide design:
Application Layer 2-1 Chapter 2 Application Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012.
Transport Layer3-1 Chapter 3 Transport Layer Computer Networking: A Top Down Approach 4 th edition. Jim Kurose, Keith Ross Addison-Wesley, July A.
CS2910 Week 1, Class 2 Today Announce Prof. Michael Vieau’s S-341 6p Thurs Wk 2 Assignment for tomorrow Data Encoding, Part 1 Parsing Data Muddiest Point.
CS2910 Week 1, Class 1 Today Introductions Class/Lab Layout Safety Review - Note about Lab Safety Review Announce Prof. Michael Vieau’s S-341 6p Thurs.
CS2910 Week 2, Class 1 Today Data Encoding, Part 1 Parsing Data Python Muddiest Point Lab 2 – Bring text In Class, Thursday: Quiz Week 6, Monday: Midterm.
Transport Layer3-1 Chapter 3 Transport Layer Computer Networking: A Top Down Approach Featuring the Internet, 3 rd edition. Jim Kurose, Keith Ross Addison-Wesley,
CS2910 Week 5, Class 2 Today DNS Muddy Points More HTTP Headers Review for Midterm Exam This coming Monday: Midterm Exam SE-2811 Slide design: Dr. Mark.
CS2910 Week 9, Class 1 Today –Quiz on SMTP –TCP: Flow control vs. Congestion Control –TCP startup, error recovery, and shut-down Before 8am Thursday: –Watch.
CS2910 Week 2, Class 1 Today Return Lab 1 Muddiest Points Quiz Parsing Data in Python SE-2811 Slide design: Dr. Mark L. Hornick Content: Dr. Hornick Errors:
CS2852 Week 6, Class 1 Today The run-time stack Writing and proving recursive methods SE-2811 Slide design: Dr. Mark L. Hornick Content: Dr. Hornick Errors:
CS2852 Week 5, Class 2 Today Queue Applications Circular Queue Implementation Testing SE-2811 Slide design: Dr. Mark L. Hornick Content: Dr. Hornick Errors:
SE1011 Week 3, Class 2 Today Sit down by someone you don't know Learn their name Find out who came farther to get to MSOE at the start of the quarter Designing.
CS2910 Week 10, Class 1 Today Modular Arithmetic RSA Week 10, Monday Quiz: Potential topics TCP window size & header format Public/private key encryption.
CS2852 Week 7, Class 1 Today Binary Search Tree Implementing add Implementing find Return Quiz 4 (second attempt) Both sections are graded SE-2811 Slide.
CS2910 Week 4, Class 1 Today Encoding in Python – Review Quiz – Encoding in Python Introduction to HTTP SE-2811 Slide design: Dr. Mark L. Hornick Content:
CS2910 Week 7, Class 2 Today Quiz on encodings IMAP Encoding "Internet Messages" Tomorrow Office hour cancelled Monday Quiz on IMAP SE-2811 Slide design:
Week 7, Class 1: The Command Pattern (cont.) Get Ready for Poll Everywhere Labs 2 & 3 returned Lab 7 due this evening at 11pm Quiz tomorrow at start of.
CS2910 Week 4, Class 2 Today Sit by someone you have not yet worked with this quarter. Learn his/her name if unknown. Turn on your laptop and start Wireshark.
CS2910 Week 8, Class 2 Today Return Quiz Look at Schedule TCP implementation! Week 8, Monday Quiz on SMTP May include some questions requiring you to interpret.
Chapter 3 Transport Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012 A note on the use of these.
CS2910 Week 7, Class 1 Today Capturing SMTP with Thunderbird Tomorrow Extra office hour at 11 am (right after lab) Friday Office hour cancelled SE-2811.
CS2910 Week 5, Class 1 Today Sit by someone you have not yet worked with Turn on your laptop and start Wireshark. DNS Next week Monday: Midterm Exam SE-2811.
Week 6, Class 3: Composite Swing composites File composites Computer composites SE-2811 Slide design: Dr. Mark L. Hornick Content: Dr. Hornick Errors:
CS2910 Week 6, Lab Today Dictionaries in Python SE-2811 Slide design: Dr. Mark L. Hornick Content: Dr. Hornick Errors: Dr. Yoder 1.
SE3910 Week 8, Class 2 Week 4 Lab: Please return your graded Lab 4 to me so I can enter it in my gradebook Week 7, Class 2 (Wednesday) Half-Exam 2 Done.
Game Networking CS381 Spring Internet ● An information superhighway ● A collection of pipes ● Arpanet – Robust communication in the face of infrastructure.
CS2911 Week 3, Class 2 Today Return Lab 3 Afternoon section: Hand out Lab 4 Checklist Review Muddiest Point Questions on Lab 4? What is a protocol? The.
Chapter 3 Transport Layer
CS2911 Week 4, Class 3 Today Next Class: DNS – Domain Name Service
Slide design: Dr. Mark L. Hornick
SE-1011 Slide design: Dr. Mark L. Hornick Instructor: Dr. Yoder
Slide design: Dr. Mark L. Hornick
Slide design: Dr. Mark L. Hornick
CS2911 Week 9, Sometime Today Week 10, Tuesday TCP
Chapter 2 Application Layer
Slide design: Dr. Mark L. Hornick
SE-1011 Slide design: Dr. Mark L. Hornick Instructor: Dr. Yoder
CS2911 Week 5, Class 3 Today Week 6, Lab: Quiz at start of lab
SE-1011 Slide design: Dr. Mark L. Hornick Instructor: Dr. Yoder
Slide design: Dr. Mark L. Hornick
CS2911 Week 2, Class 3 Today Return Lab 2 and Quiz 1
CS2911 Week 3, Class 3 (And wk4-c1)
CS2911 Week 3, Lab Today Thursday Friday Review Muddiest Point Lab 3
Slide design: Dr. Mark L. Hornick
SE-1011 Slide design: Dr. Mark L. Hornick Instructor: Dr. Yoder
Slide design: Dr. Mark L. Hornick
CS2911 Week 5, Class 3 Today Next Class: DNS – Domain Name Service
Presentation transcript:

CS2910 Week 3, Class 1 Today What is a protocol? Using TCP in Python Defining methods in Python Long procedure design SE-2811 Slide design: Dr. Mark L. Hornick Content: Dr. Hornick Errors: Dr. Yoder 1

What is a protocol? A protocol is a predetermined agreement about how to communicate It defines message order format actions taken on message transmission / receipt timeout etc. SE-2811 Dr.Yoder 2

UDP demultiplexing SE-2811 Dr.Yoder

UDP Client in Python client_socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) client_socket.sendto(message, (server_name, server_port)) client_socket.close() SE-2811 Dr.Yoder 4

UDP Server in Python server_socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) server_socket.bind((server_name,server_port)) message,clientAddress = server_socket.recvfrom(2048) server_socket.close() SE-2811 Dr.Yoder 5

TCP features Stream of data: Guaranteed delivery In-order delivery Multiple connections through same port SE-2811 Dr.Yoder 6

TCP demultiplexing 7

TCP Client in Python tcp_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) tcp_socket.connect((server_host,server_port)) tcp_socket.send(message) response = tcp_socket.recv(BUFFER_SIZE) tcp_socket.close() SE-2811 Dr.Yoder 8

TCP Server in Python listen_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) listen_socket.bind((listen_host,listen_port)) listen_socket.listen(1) data_socket, sender_address = listen_socket.accept() data = data_socket.recv(BUFFER_SIZE) data_socket.send(response_data); data_socket.close(); listen_socket.close() SE-2811 Dr.Yoder 9

Defining methods in python def main(): print bigpos([-10, 30, 4]) def bigpos(nums): bigval = None for val in nums: if val>0 and (not bigval or val > bigval): bigval = val return bigval main() # Cannot call until bigpos has been # declared SE-2811 Dr.Yoder 10 Original example by Dr. Sebern

Exercise Consider the following format: A message has a four-byte header with the number of lines in a text file as a binary number Then, the lines follow, each terminated by '\n' Suppose you can get one byte (single-byte string) of the message by calling next_byte(). Brainstorm a list of as many sub-methods for a program to parse this file as you can. SE-2811 Dr.Yoder 11

Exercise Consider the following format: A message has a four-byte header with the number of lines in a text file as a binary number Then, the lines follow, each terminated by '\n' Suppose you can get one byte (single-byte string) of the message by calling next_byte(). Write pseudocode to read in the file and stop before reading past the end. SE-2811 Dr.Yoder 12

Exercise Consider the following format: A message has a four-byte header with the number of lines in a text file as a binary number Then, the lines follow, each terminated by '\n' Suppose you can get one byte (single-byte string) of the message by calling next_byte(). Write Python code to read in the file and stop before reading past the end. SE-2811 Dr.Yoder 13

SE-2811 Dr. Josiah Yoder 14

Acknowledgement This course is based on the text Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012 SE-2811 Dr. Josiah Yoder 15