Lecture 3 (Leftover): UDP Socket Programming

I have shown you how to code a networked application that runs over TCP using Java socket programming API.

To complete the picture, please take a look at this video, from Semester 2 of last AY, that illustrates how to write a socket program over UDP. While you won’t need to code UDP program in CS2105, seeing how a UDP socket API is written and how a UDP program is used, would allow you to contrast the differences between TCP and UDP.

Problem Set 2

We will discuss Problem Set 2 during the tutorial sessions of Week 4. Download the PDF version of Problem Set 2 here. Please attempt the questions before coming to class and be prepare to present your solutions. During Week 4, if time permits, you will have an opportunity to ask and discuss any doubt that you may have from DIY Exercise 1. Please attempt the exercise before coming to class next week.

Lecture 4: Reliable Protocols

3 February, 2014.


“Sending Data Reliably over the Internet is Harder than You Think. The Intricacy Involved in Ensuring Reliability Will Make Your Head Explode.”

This is the first lecture on the transport layer. After briefly describing the role of transport layer, I will delve deep into the question of how to build a reliable protocol on top of an unreliable delivery service.

We will not discuss any actual protocol (TCP or UDP) this week.

Please read the following sections in the textbook.
Reading:
Chapter 3 of KR.

  • 3.1 Introduction
  • 3.4.1 Building a Reliable Data Transfer Protocol
  • 3.4.2 Pipelined Reliable Data Transfer Protocols

Slides:PDF

Code from Lecture 3

You can get the code (cleaned up and polished) from Lecture 3 on github:
https://github.com/weitsang/nus-cs2105-socket-programming

You can download the whole thing as a zip file (click on “Download Zip” on the lower right corner).

If you are familiar with git, feel free to clone and submit pull request if you found any bug.

DIY Exercise 1

Here is the first DIY exercise. This is an ungraded exercise, but completing the exercise will help you extend your knowledge and gain a deeper understanding of the materials covered in class.

You are encouraged to ask questions and discuss your results online on the blog.

Here is the PDF version of DIY Exercise 1.

CS2105 in the News: Big Web Crash in China

Fascinating story.

http://bits.blogs.nytimes.com/2014/01/22/big-web-crash-in-china-experts-suspect-great-firewall/

The China Internet Network Information Center, a state-run agency that deals with Internet affairs, said it had traced the problem to the country’s domain name system. One of China’s biggest antivirus software vendors, Qihoo 360 Technology, said the problems affected about three-quarters of the country’s domain-name system servers.

“I have never seen a bigger outage,” said Heiko Specht, an Internet analyst at Compuware, a technology company based in Detroit. “Half of the world’s Internet users trying to access the Internet couldn’t.”

Those domain-name servers, which act like an Internet switchboard, routed traffic from some of China’s most popular sites to an Internet address that, according to records, is registered to Sophidea, a company based, at least on paper, in that Wyoming building, in Cheyenne. It is unclear where the company or its servers are physically based, however.

Lecture 3: Socket Programming

27 January, 2014.

You Won’t Believe How Many Lines of Code It Takes To Write a Minimum Workable Web Server. You Have to See It!

After finishing off our discussion on DNS, I will show how to write simple TCP applications, include a Web server, in Java. I will also show you how to program a UDP-based networked application.

Related sections from Java API documentation: Socket, ServerSocket, DatagramSocket, , InetAddress

There is no corresponding sections in the textbook (the book uses Python for socket programming).

Source code written during class will be posted after the class.

CS2105 in the News: Biggest Land Rush in the History of the Internet

http://qz.com/165238/the-biggest-land-rush-in-the-history-of-the-internet-begins-on-february-4/

Domain names, the basis of web addresses, are overseen by the Internet Corporation for Assigned Names and Numbers (ICANN). They follow a hierarchy, much like physical addresses. If the web were a country, then a generic top-level domain like .com might be the state or province, and a second-level domain, like google.com, would be a city. Neighborhoods within the city can be found in either a suffix (google.com/images) or a prefix (images.google.com).

Issues with Tutorial Registration (Updated)

Update (7pm, 2014-01-22):

We managed to swap two groups to a larger room. We can now accommodate more students. We also increased the quota for all tutorial slots, except Tutorial 8 (due to room size).

If you emailed me earlier, you should have heard back from me. For those who still have not secured a tutorial slot, please email me, Tang Ruiming, and Zeng Yong with your preferred slots (give multiple slots) and your matric number, and we will try to slot you in as much as the room size allows.

Original Post:

I received many emails from you about not being able to bid for tutorial slot.

I checked and we have 40+ students more than last AY. This increase in number could be why there is not enough slots available.

I am sorting things out with the UG Office and timetable planner. Please hang on for further announcement (and check for new slots or increase quota in CORS).

If you have other issues with CS2105 tutorial slots, please email Tang Ruiming (tangruiming@comp.nus.edu.sg) and Zeng Yong (zengyong@comp.nus.edu.sg). They are in charge of tutorial registrations for CS2105 (and have access to the online system).

Assignment 0

Assignment 0 is an ungraded programming exercise for warming up towards your Assignments 1 and 2. You may download the PDF version of Assignment 0 here. The exercise is intentionally not well defined. It is meant to introduce you to some Java classes that you will be using in CS2105. So, play around with the classes, code as much as you like, go crazy, and have fun!