290 likes | 431 Views
Lab312. Lab312 專題生暑假需知. 每一課程都會有作業 且點名與作業表現將影響專題生是否能續留本實驗室 修習本實驗室之專題生務必要出席 在開學前會公告 final project 的機測時間,詳細資訊請看 Room312 板 點名 + 課程作業 +final project 此為續留本實驗室之條件 缺一不可. protocol. 大概說說 TCP 大概說說 HTTP. TCP. Transmission Control Protocol point-to-point: one sender, one receiver
E N D
Lab312 專題生暑假需知 • 每一課程都會有作業 • 且點名與作業表現將影響專題生是否能續留本實驗室 • 修習本實驗室之專題生務必要出席 • 在開學前會公告final project的機測時間,詳細資訊請看Room312板 • 點名+課程作業+final project 此為續留本實驗室之條件 缺一不可
protocol • 大概說說 TCP • 大概說說HTTP
TCP • Transmission Control Protocol • point-to-point: • one sender, one receiver • reliable, in-order byte steam: • no “message boundaries • connection-oriented: • handshaking (exchange of control msgs) init’s sender, receiver state before data exchange
TCP • Transmission Control Protocol
32 bits source port # dest port # sequence number acknowledgement number head len not used Receive window U A P R S F checksum Urg data pnter Options (variable length) application data (variable length) TCP URG: urgent data (generally not used) counting by bytes of data (not segments!) ACK: ACK # valid PSH: push data now (generally not used) # bytes rcvr willing to accept RST, SYN, FIN: connection estab (setup, teardown commands) Internet checksum (as in UDP)
time TCP Seq. #’s: • byte stream “number” of first byte in segment’s data ACKs: • seq # of next byte expected from other side • cumulative ACK Q: how receiver handles out-of-order segments • A: TCP spec doesn’t say, - up to implementor Host B Host A User types ‘C’ Seq=42, ACK=79, data = ‘C’ host ACKs receipt of ‘C’, echoes back ‘C’ Seq=79, ACK=43, data = ‘C’ host ACKs receipt of echoed ‘C’ Seq=43, ACK=80 simple telnet scenario
www.someschool.edu/someDept/pic.gif path name host name HTTP • Hypertext Transfer Protocol • Web page consists of objects • Object can be HTML file, JPEG image, Java applet, audio file,… • Web page consists of base HTML-file which includes several referenced objects • Each object is addressable by a URL • Example URL:
HTTP HTTP: hypertext transfer protocol • Web’s application layer protocol • client/server model • client: browser that requests, receives, “displays” Web objects • server: Web server sends objects in response to requests • HTTP 1.0: RFC 1945 • HTTP 1.1: RFC 2068 HTTP request PC running Explorer HTTP response HTTP request Server running Apache Web server HTTP response Mac running Navigator
HTTP Request Message • two types of HTTP messages: request, response • HTTP request message: • ASCII (human-readable format) request line (GET, POST, HEAD commands) GET /somedir/page.html HTTP/1.1 Host: www.someschool.edu User-agent: Mozilla/4.0 Connection: close Accept-language:fr (extra carriage return, line feed) header lines Carriage return, line feed indicates end of message
HTTP Method HTTP/1.0 • GET • POST • HEAD • asks server to leave requested object out of response HTTP/1.1 • GET, POST, HEAD • PUT • uploads file in entity body to path specified in URL field • DELETE • deletes file specified in the URL field
HTTP Response Message status line (protocol status code status phrase) HTTP/1.1 200 OK Connection close Date: Thu, 06 Aug 1998 12:00:15 GMT Server: Apache/1.3.0 (Unix) Last-Modified: Mon, 22 Jun 1998 …... Content-Length: 6821 Content-Type: text/html data data data data data ... header lines data, e.g., requested HTML file
HTTP Response Status Codes In first line in server->client response message. A few sample codes: 200 OK • request succeeded, requested object later in this message 301 Moved Permanently • requested object moved, new location specified later in this message (Location:) 400 Bad Request • request message not understood by server 404 Not Found • requested document not found on this server 505 HTTP Version Not Supported
WireShark • Wireshark(前稱Ethereal)是一個網路封包分析軟體。網路封包分析軟體的功能是擷取網路封包,並盡可能顯示出最為詳細的網路封包資料。
安裝 WireShark • http://www.wireshark.org/
作業一 • 1.利用wireshark錄製連線封包,並標出three way handshake步驟的幾個封包。 • 2.找出TCP Header中Sequence number以及Acknowledgment number欄位是做什麼用途,在連線過程中裡面的內容代表什麼意義,請清楚說明。 • Mail到 hsien0714@gmail.com • mail標題:Lab312作業一 • Mail內容:請包含學號、姓名。 • Due:8/4