CS计算机代考程序代写 FIT1047

FIT1047
FIT1047 – Week 7 Part 1
Networks: Introduction

not the internet
but how does all this work?

400hours of video uploaded to YouTube every minute in 2018 2.19 billion daily active users on Facebook in 2018
144
Exabyte of world wide Internet traffic per month in 2018
3.63
trillion US$ in online sales in 2018 https://www.digitalcommerce360.com/article/us-ecommerce-sales/
1 Exabyte = 1073741708.03 Gigabytes ~ 109 GB

FIT1047
7
Network components
Wireless Local Area Network (WLAN)
Local Area Network (LAN) switch
Wireless-client
circuit
circuit circuit
server
circuit
router Wired-client

FIT1047
8
Hierarchical Network layout
High-speed WAN routers can carry traffic across the enterprise WAN backbone, medium-speed routers can connect buildings at each campus, and switches can connect user devices and servers within buildings
Campus A
Building C-1
Building C-2
Enterprise WAN Campus B Backbone
Core Layer
Campus C Backbone
Distribution Layer
Campus C
Edge(leaf) devices
Access Layer

FIT1047
9
Network components
Client: gives users access to the network Server: stores data or software and makes
it available to the clients over the network Switch: connects computers in a LAN
Router: connects two or more networks Comm-Links: inter-connects network devices

Types of networks
Networks within an organisation:
• Local Area Network (LAN) (room, building):
a group of clients and servers that share a circuit
• Backbone Network (BN) (< a few km): high-speed connection between LANs • Metropolitan Area Network (MAN) (> a few km): connect LANs and BNs across locations
• Wide Area Network (WAN):
same as MAN except longer distances
FIT1047
10

FIT1047
11
The Monash Network

FIT1047
12
The Monash Network
Guess the size of the Monash network:
A. 100 routers/switches, 5,000 computers
B. 500 routers/switches, 10,000 computers
C. 1,000 routers/switches, 25,000 computers
D. 2,000 routers/switches, 40,000 computers
E. 5,000 routers/switches, 100,000 computers

• Based on a common, standard set of protocols
FIT1047
13
Source: Wikipedia / Opte project : https://en.wikipedia.org/wiki/Internet
The Internet
• A network of networks
• Connecting millions of networks
and billions of devices

FIT1047
14
Data transmission rates
• Fundamental characteristic of a network: how many bits per second can it transmit?
• Typical transmission rates:
• 1 Mbps (million bits per second) from your home to your ISP (Internet Service Provider), 10-20 Mbps in the other direction
• 50-500 Mbps within your WLAN (wireless network)
• 1 Gbps in LANs (local area network, e.g. Monash lab)
• 10 Gbps in backbone networks
• Tbps (tera bits per second, 1012) in optical fiber networks

How long does it take?
Assume you want to send a 4k movie (50 GB) to a friend. How long does it take if you use your home ADSL connection?
A. At most 10 Minutes B. 10-12 hours
C. Around one day
D. Roughly one week E. About one month
FIT1047
15

How long does it take?
• Typical ADSL upload speed: 1 Mbps
• 50 GByte = 400 Gbit = 400 000 Mbit
• 400 000 seconds = 4 days, 15 hours
• How about NBN? Advertised as 39 Mbps
• 400 000 Mbit / 39 Mbps = 2 hours 29 minutes
• And within the Monash network? 1 Gbps
• 400 Gbit / 1 Gbps = 6 minutes 40 seconds
http://www.meridianoutpost.com/resources/etools/calculators/calculator-file-download-time.php
FIT9135
16

FIT1047
FIT1047 – Week 7
Networks: Layers and Protocols

FIT1047
Layers and Protocols

How to transfer data
• Networks run on very diverse and complex hardware and software:
How can we make sure they all understand each other?
• Solution:
hierarchical layers of abstraction
each with well-defined tasks and interfaces
formal languages (protocols) within each layer • This is typical software engineering!
FIT1047
19

FIT1047
20
Layers of Abstraction
Application
(manage user data)
Logical connections
(break up into packets, make sure they arrive)
Routing
(where should packets go?)
209.85.142.94
203.214.44.94 216.239.46.151
Low-level connections
packet
(computer-to-computer)
Hardware
packet
(cables, WIFI etc)

Layers of Abstraction
Application
(manage user data)
Transport
(break up into packets, make sure they arrive)
Network
Internet Model
(where should packets go?)
Data link
(computer-to-computer)
(cables, WIFI etc) FIT1047
21
Physical

FIT1047
22
Layers of Abstraction
Application
(manage user data)
Transport
Interface
(break up into packets, make sure they arrive)
Network
(where should packets go?)
Data link
(computer-to-computer)
Interfaces define how each layer “talks” to the one above and below.
Physical
(cables, WIFI etc)

Layers of Abstraction
Computer 1
Protocol
Computer 2
Application Transport Network Data Link Physical
Application Transport Network Data Link Physical
Protocols define how the same layers communicate between different computers.
FIT1047
23

FIT1047
ADSL
Wi-Fi
24
Layers of Abstraction
Application Transport Network Data Link Physical
Switch
Router
Switch

FIT1047
25
Message Encapsulation
Application Transport Network Data Link Physical
Message Segment Packet
HTTP www.youtube.com PDU contains:
Protocol Data Unit
(PDU)
Frame Bit
• Protocol-specific information
• Addresses TCP
(sender/receiver)
• Error detection codes IP
Ethernet
• Special start and end
symbols

• The Internet model has five layers
Summary
• Networks consist of clients, servers, switches, routers, and other circuit hardware (e.g. cables)
• LANs connect computers directly with each other
• Each layer encapsulates the message and adds its own PDU
FIT1047
26

FIT1047
FIT1047 Week 7
Computer Networks: Application Layer

FIT1047
28
Layers of Abstraction
Switch Router Switch

FIT1047
Architectures

client server
Application Architectures
Presentation logic
The user interface. Controls the application.
Application / business logic
Defines what the application does.
Who(Client/Server) does what.. ? ?
Data access logic
Defines how the application manages its data.
Data storage
FIT1047
30
Where the data is kept, e.g. files or data base.

client server
Server-based Architecture
“dumb” terminal
Presentation logic Application / business logic Data access logic
Data storage
FIT1047
31
Client sends keystrokes to the server, displays text according to server’s instructions.
Problems:
Server can become a bottleneck. Upgrade expensive and “lumpy”.

client server
Client-based Architecture
Presentation logic Application / business logic Data access logic
Data storage
FIT1047
32
All the logic is performed by the client. The server stores the data.
Problems:
All data must travel back and forth between server and client.

client server
Client-Server Architecture
Presentation logic Application / business logic
Data access logic Data storage
FIT1047
33
Balance the processing load between
client and server.

client server
Thin-Client Architecture
Presentation logic
Application / business logic Data access logic
Data storage
FIT1047
34
Server handles most of the application logic.
Advantage:
Only one server needs updating.

FIT1047

client client
Peer-To-Peer Architecture
Presentation logic Application / business logic
Data access logic Data storage
Presentation logic Application / business logic Data access logic
Data storage
FIT1047
36
All computers act as both clients and servers.
Use local logic to access data stored on another computer.

Question: Google Drive
• Monash pays Google to provide vital services such as email, calendars,
and Google Drive, a cloud-based file storage. • Which architecture does Google Drive use? A. Client-based
B. Thin client-server
C. Server-based
D. Client-server
FIT1047

FIT1047
World Wide Web

FIT1047
39
WWW
• Based on two main technologies:
• HTTP is the protocol for communication between
browser and server
• HTML is the format in which web pages are described

HyperText Transfer Protocol (HTTP) • Defines how web browsers talk to web servers
• Invented in 1989 by Tim Berners-Lee at CERN:
“How will we ever keep track of such a large project?”
• Based on two innovative ideas:
• Hypertext:
A document containing links to other documents
• Uniform Resource Locators (URLs):
A standard for identifying links to other documents
• HTTP defines how documents are requested and transferred FIT1047
40

Request – Response-Cycle
Request
HTTP www.youtube.com
Internet
HTTP

Response

client: server:
GET /~guidot/test.html HTTP/1.1 Host: www.csse.monash.edu
Request line
FIT1047
42
Basic HTTP session
HTTP/1.1 200 OK
Date: Thu, 05 Mar 2015 08:30:48 GMT Server: Apache/1.3.26 (Unix) Transfer-Encoding: chunked Content-Type: text/html
Req. header Response

Response body

Guido Tack



status(http=status codes)
Response header

,
Server: Apache/1.3.26 (Unix) Transfer-Encoding: chunked
Basic HTTP session
Content-Type: text/html

Guido Tack



client:
Host: www.csse.monash.edu
FIT1047
43
GET /~guidot/images/guido3.jpg HTTP/1.1

client:
GET /~guidot/images/guido3.jpg HTTP/1.1 Host: users.monash.edu
server:
HTTP/1.1 200 OK
Date: Thu, 05 Mar 2015 08:31:23 GMT
Server: Apache/1.3.26 (Unix)
Last-Modified: Tue, 20 Nov 2012 03:29:22 GMT Accept-Ranges: bytes
Content-Length: 15681
Content-Type: image/jpeg
FIT1047
44

Basic HTTP session

JFIFHH@ICC_PROFILE0appl mntrRGB …

HTTP Methods
• GET:
Retrieve specified URL from server
• HEAD:
Retrieve only header for specified URL
• POST:
Add data specified in request body to specified URL
E.g. add a message to a web forum, or an item to a shopping cart. Also retrieves document.
• Other methods (PUT, DELETE, OPTIONS…) less common
FIT1047
45

Full HTTP Request
POST /~guidot/test_form.php HTTP/1.1
Host: users.monash.edu
Connection: keep-alive
Accept: text/html,application/xhtml+xml User-Agent: Mozilla/5.0 (Macintosh) Accept-Encoding: gzip, deflate, sdch Accept-Language: en-US;en
Content-Type: application/x-www-form-urlencoded Content-Length: 26
Request line
search=data+communications
Request header Request body
Request header and body are optional. HTTP 1.1 requires at least the Host header.
FIT1047
46


Response body
Full HTTP Response
HTTP/1.1 200 OK
Date: Thu, 05 Mar 2015 08:30:48 GMT Server: Apache/1.3.26 (Unix) Transfer-Encoding: chunked Content-Type: text/html
Response status

Guido Tack



Response header and body are optional.
FIT1047
47
Response header

FIT1047
48
HTTP is stateless
• Each request is an independent transaction
• Example: shopping cart
• Client browses online store
• Server responds with web pages
• Client puts item into shopping cart
• Client continues browsing
• How does the server keep track of which client put which items into the shopping cart?
(This is called the state of the session)

Adding state to HTTP • Two approaches:

Client sends session identifier with every request, e.g. encoded in URL or as data in POST

Server sets a cookie,
client transmits the cookie with every future request
HTTP
HTTP GET /index.html
FIT1047
49
GET /index.html
HTTP …

FIT1047
50
Tag
link to other asset

Guido Tack


W3C

link to other page
HTML
• HyperText Markup Language
• Plain text document annotated with tags that describe how to
format the file
• First version also developed by Berners-Lee in 1990
• Example:

• Example:
FIT1047
51
h1 {
font-family: sans-serif; color: #006020;
float: left;
}
img { float: right; }
HTML + CSS
• Separation of structure and layout:
• HTML defines what each element of the page is
• CSS defines how each element type should be displayed

FIT1047
Electronic Mail

SMTP Hi! How are you? alice@hotmail.com
SMTP
Hi! How are you? smtp.live.com
smtp.gmail.com
POP OK 2 messages
Internet
POP
LIST
bob@gmail.com

alice@hotmail.com
smtp.gmail.com
SMTP
SMTP
Internet
POP/IMAP
smtp.live.com
bob@gmail.com

Email Protocols
• Simple Mail Transfer Protocol (SMTP)
• Handles transfer of text messages between email client
and mail server, and between mail servers • Post Office Protocol (POP)
• Messages are downloaded onto client and deleted from server
• Internet Message Access Protocol (IMAP)
FIT1047
55
• Messages remain on server
• Multiple clients can be connected simultaneously to same mailbox

Example SMTP Session
220 MyMailServer ESMTP Exim 4.82 Ubuntu Sat, 07 Mar 2015 20:37:24 +1100
HELO my.laptop
250 MyMailServer Hello laptop [192.168.1.5]
MAIL FROM:
250 OK
RCPT TO:
250 Accepted
DATA
354 Enter message, ending with “.” on a line by itself
From: “Alice”
To: “Guido Tack” Date: Mon, 09 Mar 2015 19:24:00 +1000 Subject: test message
Header Body
Hi Guido!
This is just a test.
Cheers, Alice
.
250 OK id=1YUBBf-0003Ch-M1
QUIT
221 MyMailServer closing connection
FIT1047
56

• Multi-Purpose Internet Mail Extensions
• Remember: SMTP handles plain text email
• How do you attach other file types?
FIT1047
57
MIME
• MIME specifies an encoding
• Supports character sets (e.g. Unicode) to send
emails with non-latin characters
• Supports non-text attachments
• Supports multi-part message bodies

FIT1047
58
MIME uses Base64 encoding

FIT1047
59
filename=guido3.jpg Content-Type: image/jpeg;
MIME Example
–Apple-Mail=_DC544A01-B885-421C-B475-2DBBCF2DEE37 Content-Transfer-Encoding: base64
Content-Disposition: inline;
Represent image data as plain text!
name=”guido3.jpg”
Content-Id:
/9j/4AAQSkZJRgABAQEASABIAAD/4gVASUNDX1BST0ZJTEUAAQEAAAUwYXBwbAIgAABtbnRyUkdC
IFhZWiAH2QACABkACwAaAAthY3NwQVBQTAAAAABhcHBsAAAAAAAAAAAAAAAAAAAAAAAA9tYAAQ
AA
AADTLWFwcGwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAtkc2NtAAABCAAAAvJkZXNjAAAD/AAAAG9nWFlaAAAEbAAAABR3dHB0AAAEgAAAABRyWFlaAA
AElAAAABRiWFlaAAAEqAAAABRyVFJDAAAEvAAAAA5jcHJ0AAAEzAAAADhjaGFkAAAFBAAAACxnVFJ
DAAAEvAAAAA5iVFJDAAAEvAAAAA5tbHVjAAAAAAAAABEAAAAMZW5VUwAAACYAAAJ+ZXNFUwAA
ACYAAAGCZGFESwAAAC4AAAHqZGVERQAAACwAAAGoZmlGSQAAACgAAADcZnJGVQAAACgAAAE
qaXRJVAAAACgAAAJWbmxOTAAAACgAAAIYbmJOTwAAACYAAAEEcHRCUgAAACYAAAGCc3ZTRQA
AACYAAAEEamFKUAAAABoAAAFSa29LUgAAABYAAAJAemhUVwAAABYAAAFsemhDTgAAABYAAAH
UcnVSVQAAACIAAAKkcGxQTAAAACwAAALGAFkAbABlAGkAbgBlAG4AIABSAEcAQgAtAHAAcgBvAGY
AaQBpAGwAaQBHAGUAbgBlAHIAaQBzAGsAIABSAEcAQgAtAHAAcgBvAGYAaQBsAFAAcgBvAGYAaQ
BsACAARwDpAG4A6QByAGkAcQB1AGUAIABSAFYAQk4AgiwAIABSAEcAQgAgMNcw7TDVMKEwpDDr
kBp1KAAgAFIARwBCACCCcl9pY8+P8ABQAGUAcgBmAGkAbAAgAFIARwBCACAARwBlAG4A6QByAGk
AYwBvAEEAbABsAGcAZQBtAGUAaQBuAGUAcwAgAFIARwBCAC0AUAByAG8AZgBpAGxmbpAaACAA
UgBHAEIAIGPPj/Blh072AEcAZQBuAGUAcgBlAGwAIABSAEcAQgAtAGIAZQBzAGsAcgBpAHYAZQBsAH
MAZQBBAGwAZwBlAG0AZQBlAG4AIABSAEcAQgAtAHAAcgBvAGYAaQBlAGzHfLwYACAAUgBHAEIAIN
UEuFzTDMd8AFAAcgBvAGYAaQBsAG8AIABSAEcAQgAgAEcAZQBuAGUAcgBpAGMAbwBHAGUAbgBl

FIT1047
60
Two-tier vs Three-tier mail
• Two-tier:
• Client-server architecture
• Client implements application logic, talks to server
using SMTP and POP/IMAP • Three-tier:
• Thin client accesses via web application
• Server handles application logic
• Client accesses server using HTTP

HTTP HTTP
GET /mail.html Hi! How are you?
alice@hotmail.com
mail.bobsmail.com
smtp.hotmail.com bob@bobsmail.com
POP OK 2 messages SMTP Very well, thanks!
SMTP POP
Very well, thanks! LIST
Internet
SMTP IMAP
Hi! How are you? OK FETCH COMP
HTTP SMTP
… Hi! How are you?
IMAP
FETCH www.hotmail.com

alice@hotmail.com
SMTP/PO P/IMAP
smtp.gmail.com
SMTP
smtp.hotmail.com bob@gmail.com
HTTP
www.hotmail.com
Internet
SMTP/POP/IMAP

alice@hotmail.com
SMTP/PO P/IMAP
smtp.gmail.com
smtp.hotmail.com bob@gmail.com
SMTP
Internet
SMTP/ POP/ IMAP
HTTP
HTTP
www.hotmail.com
www.gmail.com

Summary
• Application architecture determines how client and server share the work load (server-based, client-based, client-server, thin-client-server, peer-to-peer)
• WWW: based on HTML hypertext and URLs, communicates using HTTP
• Email: SMTP, POP, IMAP, thin-client web mail
• Important: standard protocols enable interoperability
FIT1047
64