Preview

Website report

Good Essays
Open Document
Open Document
518 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Website report
Summary
All tasks are completed.
In this assignment, the main task is to implement the Sliding Window Protocol (SWP) in java. However, the sample code provided in the lecture notes is in C. Therefore, this main task is divided into the following sub-tasks:



Port the SWP code to Java
Implement missing timer related classes and functions

The following sections will cover these three sub-tasks.

Porting the code
Minor changes were made in order to change the syntax of the code to Java.

As seq_nr was not specified in the given files, it was replaced with int type.

In the original code, to declare a frame named s, it used the following syntax:

However, to create a frame object in Java, the code was modified accordingly.

The same change was made to the following code:

The resulting code was shown below.

The out_buf and event were not declared here because they were pre-set in the given code. In order to make the piece of code below work, credits were added as parameter.

As a result, it was changed to
NR_BUFS was the maximum buffer size (window size) that could be held to avoid redundant retransmission. Therefore, it was put in as credit to initialize the network layer with the same number of buffers.

Implementation of classes and functions
Two timer related classes were implemented for different timer purposes.


PacketTimeOut

PacketTimeOut was to monitor and time how long had passed since a packet was transmitted. 

AckTimeOut

AckTimeOut was to monitor the expiration of an acknowledgement timer.

Both of them extended from the TimerTask class and overrode the run() method to generate acktimeout_event.
On the other hand, five functions were implemented to complete the protocol.


Private void start_timer(int seq)

The start_timer started a timer function for each packet transmitted. If a packet timer already existed, it was cancelled. When the timer of a packet had expired (time_out),
that

You May Also Find These Documents Helpful

  • Good Essays

    Week 1 Lab_ CIS_115

    • 439 Words
    • 2 Pages

    List the inputs, any processes/calculations, and the outputs. Use the same valid variable names you used in Step 1.…

    • 439 Words
    • 2 Pages
    Good Essays
  • Good Essays

    Exercise 1: Review of array-based lists Create a project using the classes in the DocSharing area labeled “User-defined array list." Compile it, run it, and review the code that is given carefully. This code tests the ArrayList class provided in the lecture.…

    • 714 Words
    • 3 Pages
    Good Essays
  • Powerful Essays

    Comp3652 Unit 2 Assignment

    • 1090 Words
    • 5 Pages

    provided in a separate document. You will need to consult that document in order to complete this…

    • 1090 Words
    • 5 Pages
    Powerful Essays
  • Satisfactory Essays

    You can’t use any names that are the same as the functions, statements, and methods.…

    • 218 Words
    • 1 Page
    Satisfactory Essays
  • Good Essays

    This paper will describe the variable naming rules of three different programming languages. These three languages are Visual Basic, Python, and Java. Each of these languages has different rules that apply to them and some similarities. I will describe the rules and the similarities and differences in the next few paragraphs.…

    • 878 Words
    • 4 Pages
    Good Essays
  • Satisfactory Essays

    a particular programming problem and can often be downloaded from the Web site of the…

    • 398 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    3. In the forward() command, what does the number argument inside the parentheses do? (1.0 points)…

    • 290 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    Info1105

    • 951 Words
    • 4 Pages

    You are NOT allowed to use any 3rd‐party libraries for this assignment. All code must be your own work. NOTE: You should write your own set of JUnit tests in the test files to ensure your 4 classes are working. Part of the assignment will be automatically marked, and you will only be allowed THREE (3) attempts in total. Each required file is covered in more detail below. A skeleton project has also been provided through eLearning.…

    • 951 Words
    • 4 Pages
    Good Essays
  • Better Essays

    iv. Names for Java classes follow the same rules as for variable names. It is convention that each word in the class name begins with an upper case letter.…

    • 939 Words
    • 4 Pages
    Better Essays
  • Good Essays

    Article Report

    • 542 Words
    • 3 Pages

    In her article, “Ron Johnson Acknowledges J.C. Penney Isn’t Apple”, Diane Brady narrates the complex situation that Johnson, former Senior V.P. of Retail Operations at Apple, Inc. faces since he got appointed as the new CEO of J.C. Penney. Johnson is well known for his retail marketing strategies, creator of the Apple Stores which is listed today as the “highest performing stores in retail history” (Chazin, 2013). But with over a year in his new position, Johnson has not been able to mirror his previous retail success at the J.C. Penney Stores; instead stock prices have steadily dropped.…

    • 542 Words
    • 3 Pages
    Good Essays
  • Good Essays

    GotCookie : What is highlighted in blue is a Variable name. You can use any word you want for a variable name but there can't be any puntuation in it.…

    • 1165 Words
    • 5 Pages
    Good Essays
  • Powerful Essays

    irement” and the AS3.0 is its successor. I notice that AS3.0 is not just containing a…

    • 1535 Words
    • 7 Pages
    Powerful Essays
  • Powerful Essays

    Lab 2.6.2: Using Wireshark

    • 2260 Words
    • 10 Pages

    A packet sniffer (also known as a network analyzer or protocol analyzer) is computer software that can intercept and log data traffic passing over a data network. As data streams travel back and forth over the network, the sniffer "captures" each protocol data unit (PDU) and can decode and analyze its content according to the appropriate RFC or other specifications.…

    • 2260 Words
    • 10 Pages
    Powerful Essays
  • Better Essays

    Report on Bbc Online

    • 1485 Words
    • 6 Pages

    BBC Online is the brand name and home for the BBC's UK online service. It is a large network of websites including such high profile sites as BBC News and Sport, the on-demand video and radio services co-branded BBC iPlayer, the pre-school site Cbeebies, and learning services such as Bitesize. The BBC has had an online presence supporting its TV and radio programmes and web-only initiatives since 1994 but did not launch officially until December 1997, following government approval to fund it by TV licence fee revenue as a service in its own right. Throughout its short history, the online plans of the BBC have been subject to various public consultations and government reviews illustrating concerns from commercial rivals that its large presence and public funding distorts the UK market.…

    • 1485 Words
    • 6 Pages
    Better Essays
  • Powerful Essays

    Br Report

    • 9844 Words
    • 40 Pages

    The purpose of this report is to study and understand the relationship of word of mouth of ABAC students on Air Asia. The research objectives are set to measure the degree of independent variables of booking and pricing policy, operation, aircraft quality, and check-in service quality affect the word of mouth of Air Asia as a dependent variable as seen from the proposed conceptual model, studying the relationship between all factors towards the level of word of mouth.…

    • 9844 Words
    • 40 Pages
    Powerful Essays