MOPCON
      • 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
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Write
        • Owners
        • Signed-in users
        • Everyone
        Owners 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

      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.
      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
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Versions and GitHub Sync Note Insights Sharing URL Help
Menu
Options
Engagement control 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
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Write
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners 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

    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.
    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
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    # 给 IP 画个像 - 高春輝 {%hackmd MNcuRlXoQDak0uCmtaJKwA %} [TOC] ## 為什麼需要 IP 畫像數據? - 地理位置 - 真實用戶或服務器 - 公司或家庭 - 行為 - 是否有惡意行為?當過肉雞? ## 我們的業務已經不僅僅是 IP 庫 ## IP 畫像標籤 - 地理位置 - 手機上網 - 動態撥號 - 公司專線/小區/網路出口 - 中國特色的第三方出口 ## IP 庫是什麼?(用途) - 用戶信息獲取 - 廣告精準定向投放 - 流量行為分析 - CDN/DNS/VPN 節點就近快調度 ## 最經常會被問到的幾個問題? - 做 IP 庫還不幾單?抓公開的? ## 如何驗證 IP 庫 - 查詢 8.8.8.8 > 8.8.8.0/24 和 8.8.4.0/24 兩組 IP 使用了 ANYCAST 技術 > 這兩組 IP 在全球部署有多組服務器 - traceroute 可視化工具 Best Trace > 將 traceroute 結果在 Google Map 上繪製成路徑圖,能從圖片判斷 traceroute 查詢得到的資料是否是正確的和合理的 ## 為什麼要單獨維護一個,而不是用其他版本呢? - 起源於 ECSHOP 時代和對 CDN 的困惑 - 接近 200 家商業客戶 > 因為找不到合理的數據庫,所以只好自己做一個。 ### 需要解決的四個問題 - 準確性問題:以 WHOIS 多個 IP 數據投票為基礎來維護的話,很 LOW,不直接,非常不準確 - 規範性問題:1.描述不規範,一會北京一會北京市,如何破? 一會電信通,一會鵬博士,倒底哪個為準? - 即時性問題:IP 數據去掉非公網 IP,大概有 36 億個需要維護。全球相關機房上萬個,相關公司上十萬個,變動是正常的,工作量超大,你跟得上否? > 例如中華電信每個禮拜都有變化 - 持續性問題 ### ipip.net 版本 > 我們對準確度的要求高於精準度的要求 > ## 如何維護 IP 庫 - 首先是一個技術活 - 長期是一個力氣活 > ipv4 -> ipv6 ## 重點繼上 ipip.net 版本 我們如何維護 IP 庫? 包括但不限於: - 我們在全球的 300+ 個監測點,不斷增加中 - 自有或者其他可信任的數據來源 - 全球 WHOIS / BGP ... > 我們通過總結的一些方法通過程序或人工方式進行 IP 數據的收集分析與審核入庫 ## 需要了解的知識 - 網路以及營運商知識 - 了解全球的網路情況 - 了解全球的營運商網路網路情況 - 了解全球的數據中心分布情況 - 光纜、建設、鏈結與分布情況 - Internet Exchange Point - 網路情況非常複雜 1. 衛星上網/省級出口 2. VPN/NAT/MOBILE 3. ANYCAST/BACKBONE/MPLS 4. BGP/路由器數據出錯或偽造 5. 運營商的內網黑盒子 6. 就是不想告訴你 ## 還需要了解的知識 - 地理知識與語言知識 - 州級與國家知識 - 城市知識 - 各種語言的網站 > 各種代碼、縮寫、區號、時區、變更,等等,比你想像的要多一點點 >> 政治上的原因:(不容易掌握) >> 北土耳其塞普勒斯共和國,在地圖上看不到的國家 > 中國(大陸地區),變更變動無法得知 >> - RIR - NIR > ## IPIP.NET 數據分享 (2017.5) - 原始文本有 32GB , traceroute 300GB - 命令行與客戶端代碼25000+行 - 生成一次全球 ANS 相關數據文件的時間 - 手工整理的HOST定義文件 15000+行 >主體運行在荷蘭阿姆斯特丹和北京的伺服器上 > /* https://www.cogentco.com/en/network/looking-glass */ ## HOW TO MAKE 1. 基於各種數據,從上至下解析網路拓墣情況,制定方法 - IP - Routers - POPs - AS ## 疑難雜症之: VPN > 切身體會: > 為什麼在美國的 IP 會有中國的 GPS > 用戶在中國,但是 IP 在美國 > 網路位置與用戶位置分離 ## 基站 IP 庫 - 大家在不使用 wifi 網路的時候,使用手機通過運營商提供的網路進行上網的時候,目前方案應該都是用戶端使用私有 IP 做 NAT 轉換 - 然後對外做 NAT 轉換 - 這樣的情況就導致大家在手機端統一使用一些 IP 段進行訪問網站或 APP,一般我們稱這些相對固定的 IP 段為基站 IP ## 問題在哪兒? - 國內大部份的省都是以省級為單位劃分基站對外訪問IP,也就是說同一個出口IP,後面的對應用戶可能是跨多個城市的。 - 也有一部分省是按照市一級為單位劃分的, - 但是位置偏遠, 還有一部份地區是一段 IP 給兩三個城市同時使用,在我們的數據庫依然沒有看到 ## 特殊的黏滯效應? > 漫遊:從台北漫遊到高雄 > IP 沒有變 > 但開飛航模式再關閉後,IP 會變 ### 舉例: - 各城市的擴散範圍 - 拿台灣手機出國漫遊,使用的 IP 會是原營運商當地的 IP ## 工具介紹 BEST TRACE http://www.ipip.net/download.html ## 一個 IP 老司機的忠告 - 正確認識到基於 IP 做地理位置識別的局限性 - **網路位置 VS 用戶位置** - 正確獲得 IP 地址 (REMOTE_ADDR) - 所有基於IP的封禁政策都要有期限,哪怕是1年 - 要分析運營商以及所有者! > IP 數據庫若不正確,數據分析就會不正確。 ## 維護五年的一些大結論 - 台灣運營商很多,網路很多樣 - 我們有一些台灣客戶 - 根據我們的評估,台灣的 IP 地理位置數據只有我們做得最好 ###### tags: `MOPCON 2019`

    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

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    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