Aneesh Melkot
  • NEW!
    NEW!  Connect Ideas Across Notes
    Save time and share insights. With Paragraph Citation, you can quote others’ work with source info built in. If someone cites your note, you’ll see a card showing where it’s used—bringing notes closer together.
    Got it
      • Create new note
      • Create a note from template
        • Sharing URL Link copied
        • /edit
        • View mode
          • Edit mode
          • View mode
          • Book mode
          • Slide mode
          Edit mode View mode Book mode Slide mode
        • Customize slides
        • Note Permission
        • Read
          • Only me
          • Signed-in users
          • Everyone
          Only me Signed-in users Everyone
        • Write
          • Only me
          • Signed-in users
          • Everyone
          Only me Signed-in users Everyone
        • Engagement control Commenting, Suggest edit, Emoji Reply
      • Invite by email
        Invitee

        This note has no invitees

      • Publish Note

        Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note No publishing access yet

        Your note will be visible on your profile and discoverable by anyone.
        Your note is now live.
        This note is visible on your profile and discoverable online.
        Everyone on the web can find and read all notes of this public team.

        Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

        Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

        Explore these features while you wait
        Complete general settings
        Bookmark and like published notes
        Write a few more notes
        Complete general settings
        Write a few more notes
        See published notes
        Unpublish note
        Please check the box to agree to the Community Guidelines.
        View profile
      • Commenting
        Permission
        Disabled Forbidden Owners Signed-in users Everyone
      • Enable
      • Permission
        • Forbidden
        • Owners
        • Signed-in users
        • Everyone
      • Suggest edit
        Permission
        Disabled Forbidden Owners Signed-in users Everyone
      • Enable
      • Permission
        • Forbidden
        • Owners
        • Signed-in users
      • Emoji Reply
      • Enable
      • Versions and GitHub Sync
      • Note settings
      • Note Insights New
      • Engagement control
      • Make a copy
      • Transfer ownership
      • Delete this note
      • Save as template
      • Insert from template
      • Import from
        • Dropbox
        • Google Drive
        • Gist
        • Clipboard
      • Export to
        • Dropbox
        • Google Drive
        • Gist
      • Download
        • Markdown
        • HTML
        • Raw HTML
    Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
    Create Create new note Create a note from template
    Menu
    Options
    Engagement control Make a copy Transfer ownership Delete this note
    Import from
    Dropbox Google Drive Gist Clipboard
    Export to
    Dropbox Google Drive Gist
    Download
    Markdown HTML Raw HTML
    Back
    Sharing URL Link copied
    /edit
    View mode
    • Edit mode
    • View mode
    • Book mode
    • Slide mode
    Edit mode View mode Book mode Slide mode
    Customize slides
    Note Permission
    Read
    Only me
    • Only me
    • Signed-in users
    • Everyone
    Only me Signed-in users Everyone
    Write
    Only me
    • Only me
    • Signed-in users
    • Everyone
    Only me Signed-in users Everyone
    Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note No publishing access yet

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.

    Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Explore these features while you wait
    Complete general settings
    Bookmark and like published notes
    Write a few more notes
    Complete general settings
    Write a few more notes
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    2
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # DHCP Wireshark Lab > [name=Aneesh Melkot (1001750503)] [color=#4D92B8] ![](https://i.imgur.com/As2RpUj.png) ## Contents [TOC] ## DHCP Experiment ### Release IP Current IP is released using ```bash! $ ipconfig/release ``` This will make IP 0.0.0.0 ![](https://i.imgur.com/KXGlpmo.png) ### Start Packet Sniffer Lets start up wireshark and turn on packet capture. ![](https://i.imgur.com/A6w7rL2.png) ### Renew IP x 2 IP can be renewed using ```bash! $ ipconfig/renew ``` ![](https://i.imgur.com/T6FXb8U.png) ![](https://i.imgur.com/oVZMMba.png) ### Release IP ![](https://i.imgur.com/DSrUJba.png) ### Renew IP Again ![](https://i.imgur.com/Q9ygCrH.png) ### Bootp filter Here we can see our packet capture window with the `bootp` filter applied to show only DHCP packets. ![](https://i.imgur.com/xDAA7Mw.png) ## Experiment Questions ### Q1 DHCP on UDP or TCP? DHCP is sent over **UDP**. This can be seen below - ![](https://i.imgur.com/hRyOUSf.png) ### Q2 Timing Diagram Here we can see the full timing diagram. Red box depicts the first 4 DHCP packets. ![](https://i.imgur.com/cFMvOEt.png) #### Ports Type | Src | Dest :--:|:--:|:--:| Discover|68|67 Offer|67|68 Request|68|67 ACK|67|68 ### Q3 Link layer address of host Thi link layer address is the MAC address highlighted below. ![](https://i.imgur.com/JoOXVln.png) My machine's MAC is `94:08:53:be:94:f9`. ### Q4 DHCP Discover vs DHCP Request In one of its Options (53) the DHCP Message Type is set to `Discover (1)` for Discover packets ![](https://i.imgur.com/RkXDkZD.png) The same option is set as `Request (3)` for Request packets. ![](https://i.imgur.com/ICSuOix.png) ### Q5 Transaction ID ![](https://i.imgur.com/RWkYWig.png) As can be seen in the above image, the TX IDs are as follows - Group|XID :--:|:--:| 1| 0xe8cf7c7 2| 0x310009f7 > The client selects the **transaction ID** (xid) (often at random), and the server copies it in the answers. It serves a client-specific purpose, often enabling the client to identify the related dhcp answer to each request. [color=#4D92B8] ### Q6 SRC/DST IP Addressess ![](https://i.imgur.com/IZ6AFQ2.png) As can be seen above, here is the src dest IPs Type|SRC IP|DST IP :--:|:--:|:--: Discover | 0.0.0.0 | 255.255.255.255 Offer | 192.168.4.1 | 192.168.4.65 Request | 0.0.0.0 | 255.255.255.255 ACK | 192.168.4.1 | 192.168.4.65 ### Q7 DHCP Server IP Address My DHCP server's IP is `192.168.4.1`. ![](https://i.imgur.com/WdsKqAR.png) ### Q8 DHCP Offered IP As can be seen below the DHCP Server assigened `192.168.4.65` to my client machine. ![](https://i.imgur.com/3dKs4Tc.png) ### Q9 Relay Agent Any TCP/IP host that is used to transfer requests and responses between the DHCP server and client when the server is present on a separate network is referred to as a DHCP relay agent. After receiving DHCP messages, relay agents create a fresh message to broadcast over a different INTERFACE. Additionally, if enabled, the Relay agent information is sent with **Option 82** and the **giaddr** (gateway address of the packet) field are added by the DHCP relay agent. When the server reply is transmitted to the host, the options field is erased. ![](https://i.imgur.com/XtktFna.png) > There is no relay agent in my experiment. A value of `0.0.0.0` indicates that there is no relay agent as well.[color=#4D92B8] ### Q10 Router & Subnet Mask - The `router line` indicates where the client should send messages by default. - The `subnet mask` line tells the client which subnet mask to use. ### Q11 DHCP Trace File IP As can be seen below, the client is offered `192.168.1.101` in the attached DHCP Trace. ![](https://i.imgur.com/Z7SMbQZ.png) As can be seen below, the client **accepts** the IP address as it sends the same IP in the subsequent Request message. ![](https://i.imgur.com/UD4Wxbf.png) ### Q12 Lease Time A lease time is supplied along with the configuration information that DHCP transmits to a client. The client is permitted to use the allocated IP address for this amount of time. The length of the lease period can be adjusted in accordance with your unique requirements. This can be seen below. ![](https://i.imgur.com/RVeaOrW.png) > Lease time is **4 hours** in my case. [color=#4D92B8] ### Q13 DHCP Release Message - DHCP Release Message is the request to release the IP back to the DHCP Server. - There is no ACK for this. - Nothing happens if the release message is lost. The client will continue operation unitl its IP lease expires. ### Q14 ARP - Yes there numerous ARP messages sent out in my trace. - An ARP request is sent when a device needs a MAC address associated with an IP address, and it does not have an entry for the IP address in its ARP table. This is used to map MACs to IPs in the local network. The ARP packets can be seen below. ![](https://i.imgur.com/Kwe019j.png)

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password
    or
    Sign in via Google Sign in via Facebook Sign in via X(Twitter) Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    By signing in, you agree to our terms of service.

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully