Binary Encodings and Internet Communication

C
S
2
9
1
1
W
e
e
k
 
1
,
 
C
l
a
s
s
 
1
Upcoming
Introductions
Syllabus
Safety Review
Binary encodings
Lab 1 starts!
SE-2811
Slide design: Dr. Mark L. Hornick
Content: Dr. Hornick
Errors: Dr. Yoder
1
S
a
f
e
t
y
 
R
e
v
i
e
w
Take notes
SE-2811
Dr.Yoder
2
S
y
l
l
a
b
u
s
 
a
n
d
 
C
l
a
s
s
 
L
a
y
o
u
t
http://faculty-web.msoe.edu/yoder/cs2911
Syllabus
Free resources for students
Lab schedule
Teams of two
Python 
Coding Standard
Instructional Vocabulary
 for ESL students
SE-2811
Dr.Yoder
3
I
n
t
r
o
d
u
c
t
i
o
n
s
Find someone you don’t know and learn
Their name
One interesting thing they did this summer
Be prepared to tell this to the rest of the class
Just 2 minutes… make sure you all get a
turn!
SE-2811
Dr.Yoder
4
M
e
n
t
a
l
 
H
e
a
l
t
h
More than 25% of college students have
been diagnosed or treated by a
professional for a mental health condition
within the past year
Suicide is the 3rd leading cause of death
on college campuses.
64% of young adults who are no longer in
college are not attending college because
of a MH related reason.
5
B
i
n
a
r
y
 
E
n
c
o
d
i
n
g
s
You can store anything as 1's and 0's
Exercise: Brainstorm the types of things that
you might want to send over the internet
SE-2811
Dr.Yoder
6
H
o
w
 
d
o
 
w
e
 
s
e
n
d
 
t
h
e
s
e
 
t
h
i
n
g
s
o
v
e
r
 
t
h
e
 
i
n
t
e
r
n
e
t
?
You may need a few sheets of paper to hold
your notes on this
SE-2811
Dr.Yoder
7
SE-2811
Dr.Yoder
8
W
h
a
t
'
s
 
a
 
b
y
t
e
?
A byte is 8 bits.
So 1000
10
 can be written with two bytes:
0000 0011     1110 1000
How do you write this in hexadecimal?
SE-2811
Dr.Yoder
9
R
e
p
r
e
s
e
n
t
i
n
g
 
c
h
a
r
a
c
t
e
r
s
 
w
i
t
h
b
y
t
e
s
ASCII characters:
0100 0001 ‘A’
0100 0010 ‘B’
0110 0001 ‘a’
0011 0000 ‘0’
0011 0001 ‘1’
0000 1101 ‘\r’ CR (Carriage return)
0000 1010 ‘\n’ LF (Line feed, New line)
0010 0000 ‘ ’ (Space)
10
0100 0001 
‘A’
Byte
nibble
R
e
q
u
i
r
e
d
A
S
C
I
I
 
c
h
a
r
a
c
t
e
r
s
SE-2811
Dr.Yoder
11
 
Exercise: Suppose the ASCII  characters ‘A’,
CR, and LF are stored in a bytes object. Write
the hexadecimal shorthand for the contents of
the bytes object.
Exercise: How do you write the ASCII string
"Cab" in hexadecimal shorthand?
SE-2811
Dr.Yoder
12
U
D
P
 
H
e
a
d
e
r
SE-2811
Dr.Yoder
13
Wikipedia: User Datagram Protocol
Y
o
u
 
a
r
e
 
n
o
w
 
r
e
a
d
y
 
t
o
 
f
i
n
i
s
h
L
a
b
 
2
!
Overview Lab 2 – see website
SE-2811
Dr.Yoder
14
Q
u
e
s
t
i
o
n
s
 
a
b
o
u
t
 
L
a
b
 
2
?
What we've discussed today
Python code in lab assignment
Role of UDP in network stack
SE-2811
Dr.Yoder
15
C
S
2
9
1
1
W
e
e
k
 
1
,
 
C
l
a
s
s
 
2
Today
Syllabus
Introductions
Lab
Safety Review
Binary encodings
Lab 1 starts!
SE-2811
Slide design: Dr. Mark L. Hornick
Content: Dr. Hornick
Errors: Dr. Yoder
16
Q
u
e
s
t
i
o
n
s
?
 
SE-2811
Dr.Yoder
17
S
y
m
b
o
l
s
 
SE-2811
Dr.Yoder
18
E
x
e
r
c
i
s
e
:
 
C
o
m
p
l
e
t
e
 
t
h
e
h
e
x
a
d
e
c
i
m
a
l
 
c
o
l
u
m
n
s
19
SE-2811
Dr.Yoder
20
W
h
a
t
'
s
 
a
 
b
y
t
e
?
A byte is 8 bits.
Exercise: Consider the hexadecimal byte-dump
e8 02 1a ff
C
i
r
c
l
e
 
t
h
e
 
f
i
r
s
t
 
b
y
t
e
 
i
n
 
t
h
i
s
 
d
u
m
p
W
r
i
t
e
 
t
h
i
s
 
b
y
t
e
 
i
n
 
b
i
n
a
r
y
SE-2811
Dr.Yoder
21
E
x
e
r
c
i
s
e
Exercise: What does the byte 0x62 mean if
interpreted as an ASCII character?
Exercise: What does the byte 0x62 mean if
interpreted as a binary number?
SE-2811
Dr.Yoder
22
E
x
e
r
c
i
s
e
Exercise: What does the byte 0x44 mean if
interpreted as an ASCII character?
Exercise: What does the byte 0x44 mean if
interpreted as a binary number?
SE-2811
Dr.Yoder
23
B
i
g
 
e
n
d
i
a
n
 
/
 
l
i
t
t
l
e
 
e
n
d
i
a
n
1000
10
 can be written with the bytes
big endian:   most significant byte first
0000 0011     1110 1000
  
(03 e8)
little endian:  least significant byte first
1110 1000
 
     0000 0011
  
(e8 03)
Network order is BIG ENDIAN (whew!)
Intel machines are LITTLE ENDIAN
SE-2811
Dr.Yoder
24
E
x
e
r
c
i
s
e
Convert the number 700 to binary
Write 700 in big-endian format (in binary)
Convert the binary to hexadecimal shorthand
Write 700 in little-endian (hexadecimal
shorthand)
Repeat for 443, 587 (these are ports we will
use later in the quarter)
SE-2811
Dr.Yoder
25
 
Exercise 1: How many values can you
represent with 1 bit? 2? 3? 4? 5? 6? 7? 8? 9?
10? 
n
 bits?
Exercise 2: How many bits can you represent
with a single decimal digit (0-9)?
SE-2811
Dr.Yoder
26
SE-2811
Dr. Josiah Yoder
27
E
x
e
r
c
i
s
e
Exercise: What does the byte 0x44 mean if
interpreted as an ASCII character?
Exercise: What does the byte 0x44 mean if
interpreted as a binary number?
SE-2811
Dr.Yoder
28
 
29
B
i
g
 
e
n
d
i
a
n
 
/
 
l
i
t
t
l
e
 
e
n
d
i
a
n
1000
10
 can be written with the bytes
big endian:   most significant byte first
0000 0011     1110 1000
little endian:  least significant byte first
1110 1000
 
     0000 0011
Ex: What do these look like in hexadecimal?
Network order is BIG ENDIAN (whew!)
Intel machines are LITTLE ENDIAN
SE-2811
Dr.Yoder
30
 
Exercise 1: How many values can you
represent with 1 bit? 2? 3? 4? 5? 6? 7? 8? 9?
10? 
n
 bits?
Exercise 2: How many bits can you represent
with a single decimal digit (0-9)?
SE-2811
Dr.Yoder
31
W
i
r
e
s
h
a
r
k
 
D
e
m
o
See Wireshark
SE-2811
Dr.Yoder
32
A
c
k
n
o
w
l
e
d
g
e
m
e
n
t
This course is based on the text
Computer Networking: A Top Down
Approach 
7
th
 edition
Jim Kurose, Keith Ross
Addison-Wesley
SE-2811
Dr. Josiah Yoder
33
Slide Note

19q1: print 1,12,13,16-19,22-26

20q1-1-Lab(2-4)-021: 21-26,28-31

20q1-1-Lab(2-4)-041: 9-12,21-26,28,30 (31 is duplicate of previous slide)

CS2911

Dr. Josiah Yoder

Embed
Share

Learn about binary encodings, sending data over the internet, bytes, hexadecimal representation, and character encoding in this informative content. Dive into the basics of representing information digitally and discover how to communicate effectively in the digital world.

  • Binary Encodings
  • Internet Communication
  • Bytes
  • Hexadecimal
  • Character Encoding

Uploaded on Sep 23, 2024 | 0 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.

E N D

Presentation Transcript


  1. CS2911 Week 1, Class 1 Upcoming Introductions Syllabus Safety Review Binary encodings Lab 1 starts! SE-2811 1 Slide design: Dr. Mark L. Hornick Content: Dr. Hornick Errors: Dr. Yoder

  2. Safety Review Take notes SE-2811 Dr.Yoder 2

  3. Syllabus and Class Layout http://faculty-web.msoe.edu/yoder/cs2911 Syllabus Free resources for students Lab schedule Teams of two Python Coding Standard Instructional Vocabulary for ESL students SE-2811 Dr.Yoder 3

  4. Introductions Find someone you don t know and learn Their name One interesting thing they did this summer Be prepared to tell this to the rest of the class Just 2 minutes make sure you all get a turn! SE-2811 Dr.Yoder 4

  5. Mental Health More than 25% of college students have been diagnosed or treated by a professional for a mental health condition within the past year Suicide is the 3rd leading cause of death on college campuses. 64% of young adults who are no longer in college are not attending college because of a MH related reason. 5

  6. Binary Encodings You can store anything as 1's and 0's Exercise: Brainstorm the types of things that you might want to send over the internet SE-2811 Dr.Yoder 6

  7. How do we send these things over the internet? You may need a few sheets of paper to hold your notes on this SE-2811 Dr.Yoder 7

  8. SE-2811 Dr.Yoder 8

  9. What's a byte? A byte is 8 bits. So 100010 can be written with two bytes: 0000 0011 1110 1000 How do you write this in hexadecimal? SE-2811 Dr.Yoder 9

  10. Representing characters with bytes A ASCII characters: 0100 0001 A 0100 0010 B 0110 0001 a 0011 0000 0 0011 0001 1 0000 1101 \r CR (Carriage return) 0000 1010 \n LF (Line feed, New line) 0010 0000 (Space) 0100 0001 Byte nibble 10

  11. Required ASCII characters Hex code 0d Hex code 30 31 38 39 Hex code 41 42 43 44 45 Hex code 61 62 63 64 65 Char Char Char Char '\r' CR '0' '1' '8' '9' 'A' 'B' 'C' 'D' 'E' 'a' 'b' 'c' 'd' 'e' 0a '\n' LF 20 ' ' SP SE-2811 Dr.Yoder 11

  12. Exercise: Suppose the ASCII characters A, CR, and LF are stored in a bytes object. Write the hexadecimal shorthand for the contents of the bytes object. Exercise: How do you write the ASCII string "Cab" in hexadecimal shorthand? SE-2811 Dr.Yoder 12

  13. UDP Header Byte 0 1 2 3 1 0 1 1 1 2 1 3 1 4 1 5 1 6 Destination port 1 7 1 8 1 9 2 0 2 1 2 2 2 3 2 4 2 5 2 6 2 7 2 8 2 9 3 0 3 1 Byte Bit 0 1 2 3 4 5 6 7 8 9 Source port 0 0 4 32 Length Checksum Wikipedia: User Datagram Protocol SE-2811 Dr.Yoder 13

  14. You are now ready to finish Lab 2! Overview Lab 2 see website SE-2811 Dr.Yoder 14

  15. Questions about Lab 2? What we've discussed today Python code in lab assignment Role of UDP in network stack SE-2811 Dr.Yoder 15

  16. CS2911 Week 1, Class 2 Today Syllabus Introductions Lab Safety Review Binary encodings Lab 1 starts! SE-2811 16 Slide design: Dr. Mark L. Hornick Content: Dr. Hornick Errors: Dr. Yoder

  17. Questions? SE-2811 Dr.Yoder 17

  18. Symbols SE-2811 Dr.Yoder 18

  19. Exercise: Complete the hexadecimal columns Binary 0000 0001 0010 0011 0100 0101 0110 0111 Hexadecimal 0 1 2 Binary Hexadecimal 1000 1001 1010 1011 1100 1101 1110 1111 f 19

  20. Binary 1000 1001 1010 1011 1100 1101 1110 1111 Octal 10 11 12 13 14 15 16 17 Binary Octal 000 001 010 011 100 101 110 111 Decimal 8 9 10 11 12 13 14 15 0 1 2 3 4 5 6 7 SE-2811 Dr.Yoder 20

  21. What's a byte? A byte is 8 bits. Exercise: Consider the hexadecimal byte-dump e8 02 1a ff Circle the first byte in this dump Write this byte in binary SE-2811 Dr.Yoder 21

  22. Exercise Exercise: What does the byte 0x62 mean if interpreted as an ASCII character? Exercise: What does the byte 0x62 mean if interpreted as a binary number? SE-2811 Dr.Yoder 22

  23. Exercise Exercise: What does the byte 0x44 mean if interpreted as an ASCII character? Exercise: What does the byte 0x44 mean if interpreted as a binary number? SE-2811 Dr.Yoder 23

  24. Big endian / little endian 100010 can be written with the bytes big endian: most significant byte first 0000 0011 1110 1000 little endian: least significant byte first 1110 1000 0000 0011 (03 e8) (e8 03) Network order is BIG ENDIAN (whew!) Intel machines are LITTLE ENDIAN SE-2811 Dr.Yoder 24

  25. Exercise Convert the number 700 to binary Write 700 in big-endian format (in binary) Convert the binary to hexadecimal shorthand Write 700 in little-endian (hexadecimal shorthand) Repeat for 443, 587 (these are ports we will use later in the quarter) SE-2811 Dr.Yoder 25

  26. Exercise 1: How many values can you represent with 1 bit? 2? 3? 4? 5? 6? 7? 8? 9? 10? n bits? Exercise 2: How many bits can you represent with a single decimal digit (0-9)? SE-2811 Dr.Yoder 26

  27. SE-2811 Dr. Josiah Yoder 27

  28. Exercise Exercise: What does the byte 0x44 mean if interpreted as an ASCII character? Exercise: What does the byte 0x44 mean if interpreted as a binary number? SE-2811 Dr.Yoder 28

  29. Binary 000 001 010 011 100 101 110 111 Octal 0 1 2 3 4 5 6 7 Binary Octal unused 8 unused 9 29

  30. Big endian / little endian 100010 can be written with the bytes big endian: most significant byte first 0000 0011 1110 1000 little endian: least significant byte first 1110 1000 0000 0011 Ex: What do these look like in hexadecimal? Network order is BIG ENDIAN (whew!) Intel machines are LITTLE ENDIAN SE-2811 Dr.Yoder 30

  31. Exercise 1: How many values can you represent with 1 bit? 2? 3? 4? 5? 6? 7? 8? 9? 10? n bits? Exercise 2: How many bits can you represent with a single decimal digit (0-9)? SE-2811 Dr.Yoder 31

  32. Wireshark Demo See Wireshark SE-2811 Dr.Yoder 32

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

More Related Content

giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#