Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8745379
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T11:59:58+00:00 2026-06-13T11:59:58+00:00

i have a plan to gather netflow packets(v5) come from a mikrotik router in

  • 0

i have a plan to gather netflow packets(v5) come from a mikrotik router in c# app, i open a udp listener on the port which packets come and read the byte array, i split the packet byte array by looking at packet format caligare.com, as the packet format byte 24-27 is the “SysUptime at start of flow” , now i want to convert this 4 byte to datetime.

for example this 4 byte is 134 , 88, 157, 126
how should i do that?

thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T11:59:59+00:00Added an answer on June 13, 2026 at 11:59 am

    These 4 bytes are basically a 32-bit integer. What you must be aware of while working with network-transmitted packets is byte order, or Endianness. In network-transmitted packets, these are ordered as big-endian, while Intel x86 architecture is little-endian. This means that bytes in the packet are in the opposite order to how the machine stores them.

    This question has answers how to convert network-order (big-endian) bytes into host-order (little-endian on x86) bytes: C# little endian or big endian? You will need to convert the byte array that you have into an Int32 value in order to use IPAddress.NetworkToHost method:

    using System;
    using System.Net;
    
    int netSysUptimeAtStart = BitConverter.ToInt32(uptimeStartArray, 0)
    int sysUptimeAtStart = IPAddress.NetworkToHostOrder(netSysUptimeAtStart)
    

    Once you get the correct integer, you need to convert it to TimeSpan (not DateTime as you’re asking). The reason is that the “system uptime at start of flow” is not really a point in time, but rather a time span.

    You need to find out which measure is used for uptime — is it microseconds? seconds? Using that information, you can construct a correct TimeSpan using this:

    http://msdn.microsoft.com/ru-ru/library/system.timespan(v=vs.90).aspx

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been trying to implement an upgrade plan for my Android app which
I have the following query: select p from Plan as p where p.location =
I have a Django app written in Python 2.5 and I plan to upgrade
I have a plan to install my application which is compiled using RAD2010 in
I have a plan to build a web-site which running CGI made with Cocoa.
I have to plan this big client-server app, communicating through EJB(2.1). -The server serving
I've written a service and I plan to have multiple applications communicate with it
I would like to install Jobberbase in my website. I have a hosting plan
I have a JMeter test plan with following http request samplers. Login Call some
We have a daily maintenance plan in SQL Server 2005 that performs a full

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.