-
Notifications
You must be signed in to change notification settings - Fork 0
/
hw1.py
44 lines (36 loc) · 1.24 KB
/
hw1.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import time
def application_layer(message):
print('Adding Application Layer Header')
message = ' [Application Layer Header] ' + message
presentation_layer(message)
def presentation_layer(message):
print('Adding Presentation Layer Header')
message = ' [Presentaion Layer Header] ' + message
session_layer(message)
def session_layer(message):
print('Adding Session Layer Header')
message = ' [Session Layer Header] ' + message
transport_layer(message)
def transport_layer(message):
print('Adding Transport Layer Header')
message = ' [Transport Layer Header] ' + message
network_layer(message)
def network_layer(message):
print('Adding Network Layer Header')
message = ' [Network Layer Header] ' + message
datalink_layer(message)
def datalink_layer(message):
print('Adding Data Link Layer Header')
message = ' [Data Link Layer] ' + message
physical_layer(message)
def physical_layer(message):
print('Adding Physical Layer Header')
message = ' [Physical Layer Header] ' + message
time_end= time.time()
time_total= time_end- time_start
print('Full Message: ' + message)
print('Time Elapased: ' + str(time_total) )
return 0
message = input("Please enter a message: ")
time_start= time.time()
application_layer(message)